kubestellar / kubeflex

A flexible and scalable platform for running Kubernetes control plane APIs.
Apache License 2.0
46 stars 13 forks source link

bug: `kflex ctx` can fail silently #253

Closed MikeSpreitzer closed 3 months ago

MikeSpreitzer commented 3 months ago

Describe the bug

When the hosting cluster context extension is not present in the user's kubeconfig file, kflex ctx will not succeed but will also not print an error message and will exit with status 0 (i.e., claim success). Following is a demonstration.

mspreitz@mjs13 ~ % kubectl config unset preferences.extensions
Property "preferences.extensions" unset.

mspreitz@mjs13 ~ % kubectl config current-context
kind-kind

mspreitz@mjs13 ~ % kflex ctx
✔ Checking for saved initial context...

mspreitz@mjs13 ~ % echo $?
0

mspreitz@mjs13 ~ % kubectl config current-context
kind-kind

Steps To Reproduce

See above

Expected Behavior

Error message and non-zero exit status in this case.

Additional Context

No response