ahmetb / kubectx

Faster way to switch between clusters and namespaces in kubectl
https://kubectx.dev
Apache License 2.0
17.71k stars 1.26k forks source link

kubectx minikube=minikube deletes context #47

Closed ghost closed 6 years ago

ghost commented 6 years ago

Executed this command, and my minikube context was gone:

$ kubectx minikube=minikube Context "minikube" exists, deleting... error: cannot rename the context "minikube", it's not in ...

ahmetb commented 6 years ago

I'd say this is expected and it is shooting yourself in the foot.

To do a rename, we must first delete the existing context, then actually execute rename. The same issue would happen if your current context is "minikube" and you're doing kubectx minikube=., as this is the same thing.

I think it's not worth fixing this for now, so I'll close. The primary use case of rename is to shorten the context names.