-
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
Fix kubeadm init --token-ttl=0
/config tokenTTL: "0"
.
#54640
Conversation
8af195a
to
6c6f421
Compare
Cherry pick for |
/lgtm |
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.
Thanks @mattmoyer!
/lgtm
/test all [submit-queue is verifying that this PR is safe to merge] |
/retest |
1 similar comment
/retest |
@mattmoyer this actually seems to be a real failure:
|
Thanks, I'll take a look. I assumed it was a flake because it passed once. |
I think it started failing now as an other, related PR merged (the kubeadm man page PR) recently |
/retest Review the full test history for this PR. |
/lgtm cancel |
/approve cancel |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dmmcquay, mattmoyer Assign the PR to them by writing Associated issue: 509 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/cc @jpbetz this needs to make the 1.8.3 release-train. |
I'm taking another look now to see if I can figure out the |
/retest Review the full test history for this PR. |
1 similar comment
/retest Review the full test history for this PR. |
@mattmoyer the stack trace in the test failure:
Suggests that the nil pointer dereference happens here in
There also appears to be a
|
/retest Review the full test history for this PR. |
1 similar comment
/retest Review the full test history for this PR. |
6c6f421
to
c65dd85
Compare
/lgtm cancel //PR changed after LGTM, removing LGTM. @dmmcquay @luxas @mattmoyer @timothysc |
@jpbetz I think found the problem, we were missing an I added the import in |
16626da
to
6d49976
Compare
This was broken because the API machinery defaulting mechanism couldn't differentiate between an unset value (which should default to 24 hours) and a value explicitly set to 0 (which should mean infinite). The fix is to change `TokenTTL` from a `metav1.Duration` to `*metav1.Duration` so that `nil` can represent the unspecified value. This bug was introduced in kubernetes#48783.
6d49976
to
8ab898f
Compare
@mattmoyer Great, merged. |
What this PR does / why we need it:
This PR fixes a bug that was introduced in #48783 when we reduced the default token TTL from infinite to 24 hours.
This change worked for
kubeadm token create
but was broken forkubeadm init
because the API machinery defaulting mechanism couldn't differentiate between an unset value (which should default to 24 hours) and a value explicitly set to 0 (which should mean infinite).The fix is to change
TokenTTL
from ametav1.Duration
to*metav1.Duration
so thatnil
can represent the unspecified value.This bug was introduced in #48783.
Which issue this PR fixes: fixes kubernetes/kubeadm#509
Special notes for your reviewer:
This should be a cherry pick candidate for 1.8.x.
Here is some example output for each case:
Unspecified TTL using the `kubeadm init --token-ttl [...]` flag
1 hour TTL using the `kubeadm init --token-ttl [...]` flag
Infinite TTL using the `kubeadm init --token-ttl [...]` flag
Unspecified TTL using the `tokenTTL` configuration value
1 hour TTL using the `tokenTTL` configuration value
Infinite TTL using the `tokenTTL` configuration value
Release note:
/kind bug
cc @kubernetes/sig-cluster-lifecycle-bugs @luxas @jbeda @wackxu