-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
panic on run without current context #2458
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When I launch k9s it panics
panic: unable to activate context "": getcontext - invalid context specified: ""
goroutine 1 [running]:
github.com/derailed/k9s/cmd.Execute(...)
/builddir/build/BUILD/k9s-0.31.2/cmd/root.go:60
main.main()
/builddir/build/BUILD/k9s-0.31.2/main.go:32 +0x3c
This is because I have 7 kubernetes contexts defined, and no current context configured.
$ kubectl config view | grep "current"
current-context: ""
I always pass --context to kubectl. k9s used to open on the contexts page and I could select which one from there. Something has changed since version 0.29 which is the previous version I had installed that worked fine with this setup.
To Reproduce
Steps to reproduce the behavior:
- unset the current kubectl context,
kubectl config unset current-context - run
k9s - see error
- set kubectl current context,
kubectl config use-context $context_name - run
k9s - works
Expected behavior
If no current context is set, then open on the contexts page
Versions (please complete the following information):
- OS: Linux, Fedora 39
- K9s: v0.31.2
- K8s: v1.27.9
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
