Fix kubelet.conf server line indentation (#13277)#13284
Conversation
Signed-off-by: longyuxiang <longyuxiang@kylinos.cn>
|
|
|
Welcome @longxiucai! |
|
Hi @longxiucai. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Could you fix your CLA? |
|
/ok-to-test |
Signed-off-by: longyuxiang <longyuxiang@kylinos.cn>
|
Thanks @longxiucai |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: longxiucai, yankay The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Pull request overview
Fixes a kubeadm worker-node upgrade failure where the lineinfile task could rewrite the server: entry in kubelet.conf at an incorrect YAML indentation level, breaking kubeconfig parsing and causing kubelet to crash-loop.
Changes:
- Updates the
lineinfileregex to capture and reuse the existing indentation on theserver:line. - Enables
backrefs: trueso the replacement line preserves the matched indentation instead of hardcoding spaces.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fix invalid YAML indentation in kubelet.conf caused by hardcoded 4-space indent in lineinfile module.
The original task breaks the structure of kubelet.conf when the file uses different indentation levels.
This change uses regex back-reference to preserve original indentation.
Which issue(s) this PR fixes:
Fixes #13277
Special notes for your reviewer:
Does this PR introduce a user-facing change?: