testsuite icon indicating copy to clipboard operation
testsuite copied to clipboard

[BUG] cnf_setup fails with a stacktrace when a Kubernetes cluster is not configured

Open HashNuke opened this issue 4 years ago • 4 comments

Describe the bug

When cnf_setup is run without a Kubernetes cluster configured, then the cnf_setup command results in a crash and displays the stacktrace.

image

To Reproduce

unset KUBECONFIG
 ./cnf-testsuite cnf_setup cnf-config=./sample-cnfs/sample_nonroot/cnf-testsuite.yml

Expected behavior

Should display an error that a Kubernetes server is not accessible.

HashNuke avatar Sep 25 '21 17:09 HashNuke

hi @HashNuke is this issue still relevant for cnti?

lixuna avatar Feb 28 '24 17:02 lixuna

Confirmed. This issue still exists. Screenshot below. Tagging for contributors.

CleanShot 2024-03-04 at 18 29 15@2x

HashNuke avatar Mar 04 '24 12:03 HashNuke

I added method ensure_kubeconfig! into the create_namespace task. Also added one condition into this method, when the KUBECONFIG is unset and default path to config file does not exist, it raises the error. It looks like this: image

Also I write improvement ticket ( https://github.com/cnti-testcatalog/testsuite/issues/1968 ). There is 1 case when the test passes, but the k8s cluster is not up and running. Case occurs when KUBECONFIG is set successfully, indicating that the path to config file exists, but the file itself is empty or contains some faults, resulting k8s cluster is not running. So KUBECONFIG variable is set (the test passes), but the cluster is not running.

barmull avatar Apr 12 '24 15:04 barmull

ready for peer review, @taylor @HashNuke @agentpoyo

lixuna avatar May 10 '24 18:05 lixuna