ahmetb / kubectx

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

Context switch is not working - possible clash with same context name value #428

Open vinibali opened 1 month ago

vinibali commented 1 month ago

Hi! I have some kubeconfigs which has the same context name inside. Even kubectl is not able identify both if these are listed in the KUBECONFIG env variable, like

KUBECONFIG=/home/user/.kube/cluster1.conf:/home/user/.kube/cluster2.conf

Is there some other way to identify the kubeconfigs with the context-cluster key? Unfortunately I couldn't rename the context, because that breaks the functionality of the config. I experience pretty much the same with kubeswitch: https://github.com/danielfoehrKn/kubeswitch/issues/137

ahmetb commented 1 month ago

I'm afraid this is by design in kubectl and I agree with the design. Context name should not be the same across multiple files.