-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix grafana login issue #623
Conversation
Signed-off-by: Jian Wang <[email protected]>
@w13915984028 If the user turns on the add-on in v1.2.1, does this fix work if he upgrades to the newer version? |
For v1.2.1 -> v1.3.0, For v1.2.1 -> potential v1.2.2, we will not bump a newer version of |
Thanks for the explanation, but did you mean the |
@bk201 You are right :) , it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@Mergifyio backport v1.2 |
✅ Backports have been created
|
Problem:
The
grafana
login page showed 404.A main reason is, when accesing grafana from the local cluster, the general URL is
https://1.2.3.4/k8s/clusters/local/api/v1/....
, the Rancher will trim/k8s/clusters/local/
, this works fine for normal link. But forlogin
, it is another story, thegrafana
will return a302
code with a newLocation
, unfortunately, theRancher
will NOT add/k8s/clusters/local
back to theLocation
. When grafana's front page code runs, it will get a differentappSubUrl
and assume error, then showed 404 page.For rancher managed cluster, the regex processing in appSubUrl is not perfect to deal with
302
.Solution:
(1) For local cluster, add a fallback item in the nginx sub-filter
(2) For rancher-managed cluster, use long match in regex to avoid duplicate URL elements.
Related Issue:
harvester/harvester#4756
Test plan:
rancher-monitoring
addon. Or use this workaround [BUG] Grafana (Addon: rancher-monitoring) sign in is not working in Harvester 1.2.1 harvester#4756 (comment) in existing v1.2.1/v1.3.0 cluster.grafana
from theDashboard
page, which will open a new page.login
, trylogin
; or return to previous page, all should run smoothly.In Rancher-integration scenario, repeat the same processes.