-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Provide current namespace to InClusterConfig #21095
Conversation
b85bf6d
to
5badb57
Compare
c184ce0
to
3d079b2
Compare
Labelling this PR as size/L |
// TODO: generic way to figure out what namespace you are running in? | ||
// This way assumes you've set the POD_NAMESPACE environment variable | ||
// using the downward API. | ||
// This way assumes you've set the POD_NAMESPACE environment variable using the downward API. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this is required for backwards compatibility with old clients
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should have been prefixed with KUBERNETES_, KUBE_, or somesuch. :-(
Lots of examples use this, but I don't see it actually documented somewhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree :-(
One question on the tests, then needs @kubernetes/kube-api review (since it adds the constant that is part of the secret, and the secret schema is public API), then LGTM |
3d079b2
to
f3a4be2
Compare
f3a4be2
to
20216fa
Compare
LGTM pending @bgrant0607's review |
GCE e2e test build/test passed for commit 20216fa. |
@@ -375,6 +378,10 @@ func (e *TokensController) generateTokenIfNeeded(serviceAccount *api.ServiceAcco | |||
if needsCA { | |||
secret.Data[api.ServiceAccountRootCAKey] = e.rootCA | |||
} | |||
// Set the namespace | |||
if needsNamespace { | |||
secret.Data[api.ServiceAccountNamespaceKey] = []byte(secret.Namespace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pmorie Note that service account secrets are automatically updated.
LGTM, but we should document this. |
@k8s-bot test this Tests are more than 48 hours old. Re-running tests. |
GCE e2e test build/test passed for commit 20216fa. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 20216fa. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 20216fa. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 20216fa. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 20216fa. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
We need to be sure and build a new kubectl container for 1.2 (for use as a side-car in pods). I think we should be doing that anyway as part of the release. |
I would hope so, if only to get new kubectl features |
Fixes #21073