Read namespace from kubeconfig when explicitly passing URL #425
Labels
bug
Something isn't working
good second issue
Clearly described and reproducible, but solution less clear than "good first issue"
help wanted
Extra attention is needed
Which project are you reporting a bug for?
kr8s
What happened?
When we look up which Kubernetes server to connect to we use the following order:
kr8s
in PythonIn #360 we added support for loading the default namespace from the context set in the kubeconfig even if we are falling all the way back to using a service account credentials.
I noticed today that this is not the case when a URL is explicitly passed to
kr8s
. In this situation we always use the default namespace"default"
.In #360 it was reasonable to add this because users may be inside a Pod that has a service account, but want to configure their default namespace. In this case a very minimal kubeconfig is created with just this information in.
In the case where a URL is being provided we are intentionally overriding the kubeconfig, so perhaps we don't want to try and look up the default namespace from that config. It's not clear if the current behaviour is expected. It would be good to see that
kubectl
does.Anything else?
No response
The text was updated successfully, but these errors were encountered: