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

Mixed-case named contexts cannot be switched to from contexts view #2389

Closed
omry-arpaly opened this issue Dec 26, 2023 · 1 comment · Fixed by #2390
Closed

Mixed-case named contexts cannot be switched to from contexts view #2389

omry-arpaly opened this issue Dec 26, 2023 · 1 comment · Fixed by #2390

Comments

@omry-arpaly
Copy link

omry-arpaly commented Dec 26, 2023




Describe the bug
In K9s 0.30.3, switching contexts to contexts that are give specific names with mixed letter case (Human friendly string like "Dev-US", instead of EKS cluster arn:aws:eks:region:1234556678899:cluster/cluster-name-goes-here), results in a quick "invalid context: `Dev-US specified" (yes, a single, single quote is right there - checked the code: it's an issue with the logged message).
This started with the 0.30 release of K9s (not sure about specific regressions until the current 0.30.3).
Removing the K9s config directory and starting over doesn't seem to have a positive effect.

To Reproduce

  1. Switch to contexts view: ':ctx'
  2. Select a named context (one that has a "name:" attribute in ~/.kube/config), which has at least one uppercase letter.
  3. Get error message (the one with the single quote...)

Errors logged:

3:35PM DBG SWITCH CTX "contexts"--"Test"
3:35PM DBG Switching context "Test"
3:35PM DBG TABLE-UPDATER canceled -- "contexts"
3:35PM DBG --> Switching Context "test"--"po"
3:35PM DBG ClusterInfo updater canceled!
3:35PM WRN CustomView watcher failed error="open /Users/omry/Library/Application Support/k9s/views.yaml: no such file or directory"
3:35PM ERR invalid context `test specified
3:35PM DBG CustomViewWatcher CANCELED `/Users/omry/Library/Application Support/k9s/views.yaml!!

Expected behavior
Changing contexts by name should work normally regardless of name composition.

Versions (please complete the following information):

  • OS: 13.6.3
  • K9s: 0.30.3
  • K8s: 1.24
@omry-arpaly omry-arpaly changed the title Named contexts cannot be switched to from contexts view Named mixed-case named contexts cannot be switched to from contexts view Dec 26, 2023
@omry-arpaly omry-arpaly changed the title Named mixed-case named contexts cannot be switched to from contexts view Mixed-case named contexts cannot be switched to from contexts view Dec 26, 2023
@omry-arpaly
Copy link
Author

Thanks @derailed and @wjiec! You're awesome! 🥳

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 a pull request may close this issue.

1 participant