-
Notifications
You must be signed in to change notification settings - Fork 3
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
feat: switch currently viewed cluster #499
Conversation
nice catch! i know exactly what this is cause the same thing happened when i had to update the reconnection logic. We're able to successfully make the client because it exists in the config but when the cache gets made it sits indefinitely in the |
Avoids starting new cache if connection to client is refused. |
It is possible to have a different context name than cluster name, and its imperative we have that for the backend. As far as showing that to the users 🤷♂️ It is possible that you have 2 different contexts each with a cluster named the same. So at least for duplicate cluster names the context name will be important. @Madeline-UX do we want to show context name only if there are other contexts with duplicate cluster names? Also, for the font, Figma shows them as the same font size but i don't have a strong opinion there. |
Unable to reconnect to original cluster after attempting to connect to bad cluster.
You get an error message, the selected cluster in the dropdown remains as the original good cluster but there is no way to get it to reconnect, without refreshing the browser Would recommend the drop down updating to the bad cluster you tried to connect to, that way you can select the working cluster to reconnect. |
oh man good catch! i think the issue is not that the connection to the original cluster doesn't work (the K8sSession hasn't been updated if the switch fails), but that there's no mechanism for setting the loading to false in this case, so it remains on the error version of the loading page indefinitely. Changing the selected cluster does make sense except we'd have to update the K8sSession with no client or cache just to re-create the good one again. I'm going to see if there's a different solution first. |
can make this a follow on issue, but i have old contexts from CMS days that are really long. Looks like the dropdown truncates these (which looks nice but doesn't let me see the whole name). Maybe add a tool tip on hover to see entire name? The selected context shows the full name which looks kind of weird, so not sure how we want to handle it. |
yeah i think there are some design decisions i want to get with @Madeline-UX on. i'll make a separate issue and add this to it. Thanks for checking that though! super helpful to see more real-life cluster names. |
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.
🚀
// Set ready to false to block cluster check ticker since switching | ||
ks.ready = false | ||
|
||
defer r.Body.Close() |
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.
nit: this should be safe to remove.
defer r.Body.Close() |
See https://cs.opensource.google/go/go/+/refs/tags/go1.23.2:src/net/http/request.go;l=179-182
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.
Thanks @catsby. i'll add this to the follow on PR i'll be doing.
Description
Adds the ability for users to change which cluster they are viewing in Runtime by selecting from a list produced from the available clusters in their local Kubeconfig.
See Design Doc for more details.
Related Issue
Resolves #348
Switch -- Error state then Success
Screencast from 11-05-2024 10:35:53 AM.webm
Switch after disconnection event occurred:
Screencast from 11-05-2024 10:37:07 AM.webm