go-kubectx icon indicating copy to clipboard operation
go-kubectx copied to clipboard

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

Open tblaisot opened this issue 5 years ago • 1 comments

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

tblaisot avatar Apr 06 '20 06:04 tblaisot

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.

aca avatar Apr 07 '20 15:04 aca