-
Notifications
You must be signed in to change notification settings - Fork 1.4k
🐛 Make joinConfiguration.discovery.bootstrapToken.token optional #12107
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 object now has no required field, so there will be difference in behaviour between not specifying the object, and specifying
bootstrapToken: {}
.This is generally not desirable.
Is it valid to have an empty
bootstrapToken
? In the current use case, which alternative field would be used instead?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.
From code reading what I can see is that the both the scenario's are handled currently, If
boostStrapToken
is not set and its nil, its being initialized first.Also we have necessary checks for respecting the already set values as well.
Reference:
cluster-api/bootstrap/kubeadm/internal/controllers/kubeadmconfig_controller.go
Lines 1242 to 1284 in 3e6bc6a
Please correct If I missed anything @chrischdi @fabriziopandini
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.
I think we are ok
Discovery has two mutually exclusive options, FileDiscovery and TokenDiscovery.
If File discovery is set, TokenDiscovery must not be set
If File discovery is not set, TokenDiscovery is used, either with the values specified by the users or, if those value are missing, with defaults.
Considering this, there wont be any difference in behaviour between not specifying the object, and specifying empty bootstrapToken: in both cases you accept all the defaults for TokenDiscovery