Skip to content
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 namespace suggestion error on context switch #2315

Merged
merged 1 commit into from Nov 28, 2023

Conversation

wjiec
Copy link
Contributor

@wjiec wjiec commented Nov 27, 2023

This PR is used to supplement what was missing in #2285 and fixes a few issues.

Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wjiec Thank you for these updates Jayson!
namespaces are already cached in a lru map.

@@ -55,6 +55,7 @@ type App struct {
showHeader bool
showLogo bool
showCrumbs bool
namespaces []string
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likely not a good idea to cache the namespaces here as the list will change over the course of the session.

@wjiec
Copy link
Contributor Author

wjiec commented Nov 28, 2023

If the namespace is already cached in lru map, then we just refetch it every time?

@wjiec wjiec requested a review from derailed November 28, 2023 01:46
Copy link
Owner

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wjiec Thank you for the updates Jayson!!
Yes I think that is fine for the time being.
I do think namespaceNames and contextNames should live in the client package.
There is a similar call client.NamespaceNames available but we should replace with your impl.
We can do thsese in a separate PR.

@derailed derailed merged commit c639b6a into derailed:master Nov 28, 2023
3 checks passed
@wjiec wjiec deleted the bugfix/switch-ctx branch November 28, 2023 14:51
@derailed derailed mentioned this pull request Dec 7, 2023
thejoeejoee pushed a commit to thejoeejoee/k9s that referenced this pull request Feb 23, 2024
placintaalexandru pushed a commit to placintaalexandru/k9s that referenced this pull request Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants