Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing when there are multiple contexts in KUBECONFIG env variable. #12

Open
fmdlc opened this issue Oct 24, 2020 · 0 comments
Open

Failing when there are multiple contexts in KUBECONFIG env variable. #12

fmdlc opened this issue Oct 24, 2020 · 0 comments

Comments

@fmdlc
Copy link

fmdlc commented Oct 24, 2020

Having multiple contexts in the environment variable KUBECONFIG fails when it tries to scan the provided namespace. The result is exactly the same passing the -n my_namespace flag or providing a specific context.

$ kubectl doctor 
WARN[0000] discovered a list of kubeconfigs & will respect current-context!  kubeconfiglist="[/Users/tty0/.kube/config /Users/tty0/.kube/config-dguiaf-prod /Users/tty0/.kube/config-dguiaf-rancher /Users/tty0/.kube/config-dguiaf-dev /Users/tty0/.kube/config-dguiaf-test /Users/tty0/.kube/k3s]"
INFO[0000] Going for a full scan as no flags are set!   
INFO[0000] Retrieving necessary clientset for targeted k8s cluster. 
INFO[0000]                                              
INFO[0000] Fetched namespaces: []                       
INFO[0000]                                              
error: namespace must be specified/retrieved properly!
$: kubectl get namespaces
NAME              STATUS   AGE
default           Active   9h
kube-node-lease   Active   9h
kube-public       Active   9h
kube-system       Active   9h
monitoring        Active   9h

$: echo $KUBECONFIG
/Users/tty0/.kube/config:/Users/tty0/.kube/config-prod:/Users/tty0/.kube/config-rancher:/Users/tty0/.kube/config-dev:/Users/tty0/.kube/config-test:/Users/tty0/.kube/k3s

$: kubectl version
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.3", GitCommit:"1e11e4a2108024935ecfcb2912226cedeafd99df", GitTreeState:"clean", BuildDate:"2020-10-14T18:49:28Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.3+k3s1", GitCommit:"974ad30be7b7b15f695d88e46ffa96a4d43b2370", GitTreeState:"clean", BuildDate:"2020-10-16T00:18:50Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/arm64"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant