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

Flag 'kubeconfig-path' not reading multiple files in folder #141

Open
lucasvc opened this issue Sep 13, 2024 · 0 comments
Open

Flag 'kubeconfig-path' not reading multiple files in folder #141

lucasvc opened this issue Sep 13, 2024 · 0 comments

Comments

@lucasvc
Copy link

lucasvc commented Sep 13, 2024

I have the following file structure

/
└── home
    └── lucasvc
        └── .kube
            └── configs
                ├── cl_A-dev-1.yaml
                ├── cl_A-stage-1.yaml
                ├── cl_B-dev-1.yaml
                └── cl_B-stage-1.yaml

For two different clusters (cl_A and cl_B) and two environments for each cluster (dev and stage).
When executing

switch --kubeconfig-path /home/lucasvc/.kube/configs/

I got a 0/0.

Also tried debug list,

$ switch --debug --kubeconfig-path /home/lucasvc/.kube/configs/ list-contexts
DEBU[0000] Using kubeconfig path from flag /home/lucasvc/.kube/configs/
DEBU[0000] Starting search for store: filesystem         store=filesystem

empty list.

If I set a KUBECONFIG environment variable listing all the configuration files, on open switch allows the selection of the cluster/environment.
And with debug list,

$ switch --debug list-contexts
DEBU[0000] Adding kubeconfig path from KUBECONFIG env /home/lucasvc/.kube/configs/cl_A-dev-1.yaml.yaml:/home/lucasvc/.kube/configs/cl_A-stage-1.yaml:/home/lucasvc/.kube/configs/cl_B-dev-1.yaml:/home/lucasvc/.kube/configs/cl_B-stage-1.yaml
DEBU[0000] Adding kubeconfig path from KUBECONFIG env /home/lucasvc/.kube/configs/cl_A-dev-1.yaml.yaml:/home/lucasvc/.kube/configs/cl_A-stage-1.yaml:/home/lucasvc/.kube/configs/cl_B-dev-1.yaml:/home/lucasvc/.kube/configs/cl_B-stage-1.yaml
DEBU[0000] Adding kubeconfig path from KUBECONFIG env /home/lucasvc/.kube/configs/cl_A-dev-1.yaml.yaml:/home/lucasvc/.kube/configs/cl_A-stage-1.yaml:/home/lucasvc/.kube/configs/cl_B-dev-1.yaml:/home/lucasvc/.kube/configs/cl_B-stage-1.yaml
DEBU[0000] Adding kubeconfig path from KUBECONFIG env /home/lucasvc/.kube/configs/cl_A-dev-1.yaml.yaml:/home/lucasvc/.kube/configs/cl_A-stage-1.yaml:/home/lucasvc/.kube/configs/cl_B-dev-1.yaml:/home/lucasvc/.kube/configs/cl_B-stage-1.yaml
DEBU[0000] Starting search for store: filesystem         store=filesystem
DEBU[0000] GetKubeconfigForPath: /home/lucasvc/.kube/configs/cl_A-dev-1.yaml.yaml not cached  store=filesystem
DEBU[0000] GetKubeconfigForPath: /home/lucasvc/.kube/configs/cl_A-stage-1.yaml not cached  store=filesystem
DEBU[0000] GetKubeconfigForPath: /home/lucasvc/.kube/configs/cl_B-dev-1.yaml not cached  store=filesystem
DEBU[0000] GetKubeconfigForPath: /home/lucasvc/.kube/configs/cl_B-stage-1.yaml not cached  store=filesystem
cl_B-dev-1
cl_B-stage-1
cl_A-dev-1
cl_A-stage-1
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