Namespace lookup fails on in-cluster config #32352
Labels
area/kubectl
priority/important-soon
Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
sig/api-machinery
Categorizes an issue or PR as relevant to SIG API Machinery.
Milestone
In 1.2 we added the idea of the local namespace context to a service account token - the service account injects
/var/run/secrets/kubernetes.io/namespace
into each container with a value equal to the application's current namespace. kubectl is primed to use this value (and does so today) to set the default namespace. However, we never wired it up properly when a non-default value was selected from the server, so as with #31947 if you try to load both ClientConfig() and Namespace() from in-cluster config without a default server set in the client config loader stack, you get back an error on Namespace because it never looks at icc.Possible().kubectl
continues to work because it still provides a default.In 1.5 we should fix it similarly to #31947, but as part of the v2 kubeconfig rework #30395 we need to refactor this code to be less ugly.
The text was updated successfully, but these errors were encountered: