-
Notifications
You must be signed in to change notification settings - Fork 292
Fixed an issue where the current cluster is used when navigating to the auth configuration portion of the app #15535
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
base: master
Are you sure you want to change the base?
Conversation
…he auth configuration portion of the app Fixes rancher#10709
export const useTabCountUpdater = () => { | ||
const tabKey = randomStr(); | ||
const updateCount = inject<UpdateCountFn>(UPDATE_COUNT_PROVIDER_KEY); | ||
const updateCount = inject<UpdateCountFn | undefined>(UPDATE_COUNT_PROVIDER_KEY, undefined); |
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.
shell/config/product/auth.js
Outdated
to: { | ||
name: 'c-cluster-product-resource', | ||
params: { | ||
product: 'auth', resource: 'management.cattle.io.user', cluster: 'local' |
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.
this doesn't feel like the right fix, and will probably error if the user doesn't have access to the local cluster.
will add more detail tomorrow, but the general approach is to keep the current cluster
store pointing at the last cluster visited to avoid resetting on navigation when it isn't needed.
in this instance we should use the blank cluster _
and / or fix the place where it's looking at the cluster
store
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.
Wont the user need access to the local store to be able to touch anything in auth?
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.
It did appear to be consistent with how we link to the users page in the same file https://github.com/rancher/dashboard/blob/master/shell/config/product/auth.js#L56-L63
But I'll wait for the details tomorrow.
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.
Auth resources are provided by the management store, which does access the local cluster but not via the steve proxy directly to it (ish). That mechanism is how users can create clusters, projects, bindings, etc in the local cluster without being a member of the local cluster. So users could be granted access to see users & auth but not see general local cluster resources.
https://github.com/rancher/dashboard/blob/master/shell/config/product/auth.js#L56-L63 looks like a bug. Think i put that in a looong time ago.
Think the fix here is to update shell/models/management.cattle.io.projectroletemplatebinding.js projectDetailLocation
and possibly clusterDetailLocation
to include the correct cluster in params
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.
@richard-cox you're right about using the blank cluster; I've gone ahead and switched to blank cluster. However, based on where you think this should be fixed I think you're assuming this pr is trying to fix more than I intended.
There's no longer a problem with how projects are displayed in the Project Roles tab. I thought it would be nice to make our management pages more consistent instead of just closing the issue as already fixed.
Summary
Fixes #10709
Technical notes summary
Added a route definition which includes the
_
blank cluster as a param.Areas or cases that should be tested
Navigating to the auth configuration from both local and downstream clusters and verifying we always see the local cluster in the url.
Areas which could experience regressions
Navigating to the auth configuration from both local and downstream clusters and verifying we always see the
_
blank cluster in the url.Screenshot/Video
local-auth.mp4
Checklist