rad-security / kbom

KBOM - Kubernetes Bill of Materials
Apache License 2.0
301 stars 22 forks source link

KUBECONFIG with multiple files not working #129

Open Rhadros opened 4 months ago

Rhadros commented 4 months ago

Kbom is not working with KUBECONFIG environment variable and multiple files defined.

I am working with multiple clusters and I define them as one file per cluster. All files are then appended to the environment variable like this:

export KUBECONFIG="config-demo:config-demo-2:config-demo-3:config-demo-4"

With kubectl and other tools this is no problem, but kbom shows this error:

failed to get kubernetes out-cluster client: stat config-demo:config-demo-2:config-demo-3:config-demo-4 no such file or directory

There is no difference when I select the context first via kubectl use-context or specify via ./kbom generate -c context.

When changing KUBECONFIG to only one file everything works as expected.

$ ./kbom version
kbom version 0.2.5
build date: 2024-05-02 19:17:14
commit: 5873ff285776c931b4158b76c91074620589d16f

https://github.com/ksoclabs/kbom
$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 23.10
Release:    23.10