suspicious-pods icon indicating copy to clipboard operation
suspicious-pods copied to clipboard

Consider support multiple kubeconfigs

Open Dentrax opened this issue 4 years ago • 2 comments

If we set multiple KUBECONFIG in our $KUBECONFIG env flag, suspicious-pods could not understand and throws an exception:

$ export KUBECONFIG=$KUBECONFIG:$HOME/.kube/config:$HOME/.kube/config-foo:$HOME/.kube/config-bar
$ suspicious-pods

Error: Kubeconfig(ConfigInferenceExhausted { cluster_env: Kubeconfig(MissingInClusterVariables { hostenv: "KUBERNETES_SERVICE_HOST", portenv: "KUBERNETES_SERVICE_PORT" }), kubeconfig: Kubeconfig(ReadFile { path: ":/Users/furkan/.kube/config:/Users/furkan/.kube/config-foo:/Users/furkan/.kube/config-bar", source: Os { code: 2, kind: NotFound, message: "No such file or directory" } }) })

I think it should recognize that if given input is multiple files.

Dentrax avatar Jan 15 '21 07:01 Dentrax

Looks like the underlying library doesn't really support it. Although they have a workaround listed using kubectl to flatten the configs into a tmp config....

clux/kube-rs#132

JTarasovic avatar Jan 26 '21 22:01 JTarasovic

We should have it supported in the next release. https://github.com/clux/kube-rs/pull/411

kazk avatar Feb 10 '21 19:02 kazk