aca / go-kubectx

5x-10x faster alternative to kubectx. Uses client-go.
134 stars 3 forks source link

Corruption of config files (all field are set to null) #11

Open tblaisot opened 4 years ago

tblaisot commented 4 years ago

When using multiple config file (by using a KUBECONFIG env var containing multiple paths separated by ":") and launching kubectx, all the files not already in used are modified with all the field set to null.

apiVersion: v1
clusters: null
contexts: null
current-context: delivery
kind: Config
preferences: {}
users: null

The documentation about contiguring the KUBECONFIG env variable: https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#set-the-kubeconfig-environment-variable

aca commented 4 years ago

Thanks for the report! This is obviously bug.

I think I should look into how kubectl load it's context (thought I implemented in same way). But I'm so busy right now. I'm not sure when I might fix this. Please use single kubeconfig for now or just use https://github.com/ahmetb/kubectx.