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

Namespace lookup fails on in-cluster config #32352

Closed
smarterclayton opened this issue Sep 9, 2016 · 2 comments · Fixed by #32393
Closed

Namespace lookup fails on in-cluster config #32352

smarterclayton opened this issue Sep 9, 2016 · 2 comments · Fixed by #32393
Assignees
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.

Comments

@smarterclayton
Copy link
Contributor

smarterclayton commented Sep 9, 2016

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.

@smarterclayton
Copy link
Contributor Author

Marking this as p1 since it's broken for people who depended on it before, but it's not important enough to hold 1.4.0. I would like to put it in a 1.4.1 release.

@smarterclayton smarterclayton added this to the v1.4-nonblocking milestone Sep 9, 2016
@smarterclayton smarterclayton added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. area/kubectl labels Sep 9, 2016
@smarterclayton
Copy link
Contributor Author

And we need to be testing this inside a container running on Kube so we know it isn't broken.

@smarterclayton smarterclayton self-assigned this Sep 9, 2016
@mml mml added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Sep 10, 2016
k8s-github-robot pushed a commit that referenced this issue Sep 13, 2016
Automatic merge from submit-queue

Allow namespace to be loaded from in-cluster config

This is a follow on from the previous commit that fixed ClientConfig.
Namespace can also be defaulted from ICC, and this correctly handles
that logic. Also add two debugging lines to ensure that it is easier in
the future to uncover problems here.

Fixes #32352

@deads2k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants