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
kubeadm: add basic validation around kubelet.conf parsing #86216
kubeadm: add basic validation around kubelet.conf parsing #86216
Conversation
If the user has modified the kubelet.conf post TLS bootstrap to become invalid, the function getNodeNameFromKubeletConfig() can panic. This was observed to trigger in "kubeadm reset" use cases. Add basic validation and unit tests around parsing the kubelet.conf with the aforementioned function.
apiEndpoints: | ||
` + nodeName + `: | ||
apiEndpoints: | ||
` + nodeName + `: |
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.
these are some whitespace auto-cleanups by my editor.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: neolit123 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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 @neolit123 !
/lgtm
What this PR does / why we need it:
If the user has modified the kubelet.conf post TLS bootstrap
to become invalid, the function getNodeNameFromKubeletConfig() can
panic. This was observed to trigger in "kubeadm reset" use cases.
Add basic validation and unit tests around parsing the kubelet.conf
with the aforementioned function.
Which issue(s) this PR fixes:
NONE
Special notes for your reviewer:
reported here:
https://kubernetes.slack.com/archives/C2P1JHS2E/p1576160868007800
i don't think we should backport because it's an edge-case.
but we definitely had this issue in a number of places in kubeadm already.
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/priority important-longterm
/assign @fabriziopandini @rosti
/kind bug