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

KUBECONFIG with multiple entries doesn't work when running the container #550

Open
jc-rh opened this issue Jun 7, 2021 · 3 comments
Open

Comments

@jc-rh
Copy link
Member

jc-rh commented Jun 7, 2021

podman run --rm --network host -v /home/jun/.kube/config:/usr/tnf/kubeconfig/config:ro -v /home/jun/.kube/nmlabconfig:/usr/tnf/kubeconfig/config.2:ro -v /data/test-network-function/test-network-function:/usr/tnf/claim:Z -e KUBECONFIG=/usr/tnf/kubeconfig/config:/usr/tnf/kubeconfig/config.2 -e TNF_MINIKUBE_ONLY=false -e TNF_ENABLE_CONFIG_AUTODISCOVER=false -e PATH=/usr/bin:/usr/local/oc/bin quay.io/openshift-kni/cnf-tests:latest /usr/bin/test-run.sh --junit /usr/tnf/claim -ginkgo.v '-ginkgo.skip=performance|sriov|ptp|sctp|xt_u32|dpdk|ovn'
running /usr/bin//validationsuite --junit /usr/tnf/claim -ginkgo.v -ginkgo.skip=performance|sriov|ptp|sctp|xt_u32|dpdk|ovn
ERROR: logging before flag.Parse: I0607 14:29:56.940886 2 clients.go:74] Failed to init kubernetes client, please check the $KUBECONFIG environment variable
I0607 14:29:58.379567 2 request.go:655] Throttling request took 1.04934837s, request: GET:https://api.nmlabcluster.webscale.nm-lab.com:6443/apis/scheduling.k8s.io/v1?timeout=32s
Running Suite: CNF Features e2e validation
==========================================
Random Seed: 1623076196
Will run 17 of 36 specs

Failure [0.000 seconds]
[BeforeSuite] BeforeSuite
/go/src/github.com/openshift-kni/cnf-features-deploy/cnf-tests/testsuites/validationsuite/test_suite_test.go:55

Verify the KUBECONFIG environment variable
Expected
<*client.ClientSet | 0x0>: nil
not to be nil

@jc-rh
Copy link
Member Author

jc-rh commented Jun 7, 2021

Both config files are valid. It works if either one is removed from the KUBECONFIG var.

@yuvalk
Copy link
Member

yuvalk commented Jun 7, 2021

yeah, I think the -v $KUBECONFIG:/kubeconfig -e KUBECONFIG=/kubeconfig does not allow for that. it's assuming a single file

If you truely need this, you can do -v $DIR_WITH_KUBECONFIGS:/kubeconfig -e KUBECONFIG=/kubeconfig/kube1.conf:/kubeconfig/kube2.conf

but cnf-tests cant run on multiple clusters, so I think you'd better pass it a single conf file

@jc-rh
Copy link
Member Author

jc-rh commented Jun 9, 2021

Right, we never meant to run it on multiple clusters. It's just a convenience thing. We often switch contexts between clusters and compare results. And it's not super straightforward to merge multiple cluster config into one single file.

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

2 participants