feat(ui): add multi-cluster user logout#4425
feat(ui): add multi-cluster user logout#4425alokdangre wants to merge 5 commits intokubernetes-sigs:mainfrom
Conversation
|
Welcome @alokdangre! |
4fa5f4b to
a9ece5c
Compare
There was a problem hiding this comment.
Thanks for this!
Can you please check the git commit guidelines in the development documentation and update your commit message? You can compare your message to other ones.
The frontend tests are failing in the GitHub check. Can you please try running the tests locally? Also, can you please add a storybook state for this?
There was a problem hiding this comment.
Pull request overview
Adds multi-cluster-aware user identity display and logout behavior in the TopBar, including a hook fix to keep multi-cluster selection derived from the URL in sync.
Changes:
- Updated
TopBarto fetch/display per-cluster authenticated user info and provide per-cluster (and “logout all”) actions. - Added
SelfSubjectReview-based user info fetching (getClusterUserInfo) in the v1 cluster API layer. - Fixed
useSelectedClustersto react to pathname changes (not only cluster changes) for correct multi-cluster state updates.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| frontend/src/lib/k8s/index.ts | Updates useSelectedClusters to recompute when location.pathname changes. |
| frontend/src/lib/k8s/api/v1/clusterApi.ts | Adds ClusterUserInfo + getClusterUserInfo() using the SelfSubjectReview API with fallback behavior. |
| frontend/src/components/App/TopBar.tsx | Implements multi-cluster user menu UX, per-cluster logout, and queries user info for selected clusters. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a9ece5c to
a61d03c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
a61d03c to
0c38f12
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@illume sorry for that test error, i forgot to take snapshot, i have also added the requested changes |
|
@illume ptal |
|
@illume ,
Sure, but this I would say is the equivalent of logging out of a cluster from the home view, which is showing all clusters there. I would err on not providing this option and instead just the "Log out of these grouped clusters" if we need a log out from all while visualizing a group of clusters. |
Implement getClusterUserInfo in clusterApi to fetch user details using SelfSubjectReview. Export the function in apiProxy and add unit tests. Signed-off-by: alokdangre <alokdangre@gmail.com>
…anges Update useSelectedClusters to use useLocation and track pathname changes, fixing a bug where cluster selection state could become stale. Signed-off-by: alokdangre <alokdangre@gmail.com>
Fetch and display authenticated user information per cluster in the user menu. Fallback to showing the cluster name if no user info is available. Update TopBar stories to reflect multi-user scenarios. Update e2e tests to match the new menu item structure. Signed-off-by: alokdangre <alokdangre@gmail.com>
a806ab8 to
fe0a589
Compare
|
@alokdangre what do you think of the last comment? If it’s not clear, can you please ask Joaquim to expand on the bits that aren’t clear? If you disagree on some points, can you please explain why? |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
this seems good to me, |
fe0a589 to
d1b2010
Compare
Add logic to handle logout from specific clusters in a multi-cluster context. Update the URL to remove the logged-out cluster while persisting the view for remaining clusters. Signed-off-by: alokdangre <alokdangre@gmail.com>
d1b2010 to
03c29fd
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alokdangre, illume The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
joaquimrocha
left a comment
There was a problem hiding this comment.
Found some code that can be optimized for readability.
824137e to
3b20d05
Compare
Remove per-cluster logout functionality as it is not desired. Add unit tests for handleLogoutPathUpdate and ensure stories use isolated query clients. Signed-off-by: alokdangre <alokdangre@gmail.com>
Summary
Related Issue
Fixes #4082
Changes
Steps to Test
Screenshots (if applicable)
Screen.Recording.2026-01-23.145438.mp4