Skip to content

Commit

Permalink
fix: Set namespace to user namespace obtained from /userinfo service (#…
Browse files Browse the repository at this point in the history
…9191)

Signed-off-by: Yuan Tang <[email protected]>
  • Loading branch information
terrytangyuan authored Jul 20, 2022
1 parent e4489f5 commit d5d4628
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions ui/src/app/app-router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export const AppRouter = ({popupManager, history, notificationsManager}: {popupM
useEffect(() => {
services.info.getUserInfo().then(userInfo => {
Utils.userNamespace = userInfo.serviceAccountNamespace;
setNamespace(Utils.currentNamespace);
});
services.info
.getInfo()
Expand Down
2 changes: 1 addition & 1 deletion ui/src/app/shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export const Utils = {
},

get currentNamespace() {
// we always prefer the managed namespace
// we always prefer the user namespace
return this.userNamespace || this.managedNamespace || this.fixLocalStorageString(localStorage.getItem(currentNamespaceKey));
},

Expand Down

0 comments on commit d5d4628

Please sign in to comment.