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

[Go] shouldn't use XDG_CACHE_HOME for reading kubeconfigs #254

Open ahmetb opened 4 years ago

ahmetb commented 4 years ago

bash based implementations used something like KUBECTX="${XDG_CACHE_HOME:-$HOME/.kube}/kubectx" to determine where the "state files" are stored.

XDG_CACHE_HOME is good for that kinda stuff.

However with the Go implementations, that path is also used for determining where the $KUBECONFIG file is at by default –which is not correct. client-go default config loading rules don't read XDG_ env vars.

This only impacts users who had a XDG_CACHE_HOME set. If they did so, we'll look for the kubeconfig at $XDG_CACHE_HOME/.kube/config and not $HOME/.kube/config which is a bug.

josegonzalez commented 1 year ago

I think this can be closed.