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

Start in context view if current-context is empty #799

Closed
pdecat opened this issue Jul 9, 2020 · 2 comments
Closed

Start in context view if current-context is empty #799

pdecat opened this issue Jul 9, 2020 · 2 comments

Comments

@pdecat
Copy link

pdecat commented Jul 9, 2020




Is your feature request related to a problem? Please describe.

Since minikube v1.1.0, minikube stop unsets the current-context after completion: kubernetes/minikube#4177

When minikube is stopped there's no way to start k9s without changing the current context in kubeconfig:

# kubectl config current-context
minikube

# minikube stop
✋  Stopping "minikube" in kvm2 ...
🛑  Node "minikube" stopped.

# kubectl config current-context
error: current-context is not set

# grep current-context ~/.kube/config
current-context: ""

# k9s
 ____  __.________
|    |/ _/   __   \______
|      < \____    /  ___/
|    |  \   /    /\___ \
|____|__ \ /____//____  >
        \/            \/

Boom!! Invalid kubeconfig context detected.

Passing -c ctx to start in context view does not help:

# k9s -c ctx
 ____  __.________
|    |/ _/   __   \______
|      < \____    /  ___/
|    |  \   /    /\___ \
|____|__ \ /____//____  >
        \/            \/

Boom!! Invalid kubeconfig context detected.

Describe the solution you'd like

It would be awesome if k9s would start in context view when the current-context is unset instead of exiting.

Describe alternatives you've considered

Submit a feature request to minikube to allow opting-out of removing the current context from kubeconfig on stop.

Additional context

N/A

@derailed
Copy link
Owner

@pdecat Thanks Patrick! Please checkout v0.21.3

@pdecat
Copy link
Author

pdecat commented Jul 23, 2020

Awesome, works perfectly now!

Thanks @derailed!

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

No branches or pull requests

2 participants