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

Namespace/Settings keeps resetting #2560

Closed
cwrau opened this issue Feb 23, 2024 · 10 comments
Closed

Namespace/Settings keeps resetting #2560

cwrau opened this issue Feb 23, 2024 · 10 comments
Labels
bug Something isn't working question Further information is requested

Comments

@cwrau
Copy link
Contributor

cwrau commented Feb 23, 2024




Describe the bug
Since the feature to have a config file per context has been introduced, having the same context open in multiple kubeconfigs / k9s leads to the namespace getting reset.

I have k9s open and do :ns, select a namespace and press <enter> and k9s switches to the default namespace.
Or I somehow managed to get into a namespace do :ma, or any other resource, and k9s switches to that resource in the default namespace

To Reproduce
Really weird to reproduce, doesn't happen always, but I'm happy to help with debugging

Historical Documents
I've tried to screen record this, but just waiting a bit after it happened a couple of times often "fixes" it.

Expected behavior
Not this

Screenshots

Versions (please complete the following information):

  • OS: Arch Linux
  • K9s: 0.31.5
  • K8s: N/A

Additional context

@derailed
Copy link
Owner

@cwrau Thanks for the heads up Chris. Could you update to the latest and see if we're happier?

@derailed derailed added the question Further information is requested label Feb 24, 2024
@cwrau
Copy link
Contributor Author

cwrau commented Feb 24, 2024

@cwrau Thanks for the heads up Chris. Could you update to the latest and see if we're happier?

Oh, I didn't expect the arch package to be out of date, will try the newer versions on monday!

@den-is
Copy link
Contributor

den-is commented Feb 26, 2024

I can confirm, for myself happens with 0.31.9.
Without switching context, exiting/opening the app again resets visited namespaces.

I'm using custom location for k9s configs, configured with $K9S_CONFIG_DIR
Removing k9s directory for cluster config and starting from scratch doesn't help

@NeonSludge
Copy link

Can confirm, seeing this with 0.31.9. It seems that the favorite namespaces list doesn't get updated.

@derailed
Copy link
Owner

derailed commented Mar 1, 2024

@cwrau Ok so this is the case of the last one to write wins when multiple k9s sessions using the same context are open.
I think there is indeed an issue with the current impl since we just lay over the previous content and hence this issue ;(
I'll take a crack on correcting the behavior and will also include an implicit save aka CtrlP for persist to force a configuration sync.

Also do you have ui.reactive turned on or off?

@derailed derailed added the bug Something isn't working label Mar 1, 2024
@den-is
Copy link
Contributor

den-is commented Mar 2, 2024

Just in case, will add more info from my side, after the author's last comment.
I'm not using multiple k9s at once. (maybe very rarely, can't remember)
k9s.ui.reactive=false - never touched.

derailed added a commit that referenced this issue Mar 2, 2024
@derailed
Copy link
Owner

derailed commented Mar 2, 2024

@den-is Thank you for the additional details! Let's see if we're happier on v0.32.0

@den-is
Copy link
Contributor

den-is commented Mar 3, 2024

@derailed bug persists.
install 0.32.0
config location: $K9S_CONFIG_DIR=~/project/.k9s
rm -rf ~/project/.k9s/*
open k9s. choose ns using either variant : :po karpenter, :ns > kube-system
make sure that list of recently used NSs is populated (all, default, karpenter, kube-system).
exit k9s Ctrl+C

re-open k9s: observe list of namespaces reset. list contains only: all, default

@derailed
Copy link
Owner

derailed commented Mar 3, 2024

@den-is how about :q vs ctrl-c

@alewis001
Copy link

@cwrau Ok so this is the case of the last one to write wins when multiple k9s sessions using the same context are open. I think there is indeed an issue with the current impl since we just lay over the previous content and hence this issue ;( I'll take a crack on correcting the behavior and will also include an implicit save aka CtrlP for persist to force a configuration sync.

Also do you have ui.reactive turned on or off?

Just as an FYI, the introduction of the ctrl-p key binding does not appear in the Help menu (I.e. the popup triggered by ?). I only realised something had changed when one of my plugins, which I had bound to ctrl-p, stopped working and I was seeing a message about the context being saved instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants