🐛 Fix CLC rendering for mounts, optional overwrite and indented file content - #14032
🐛 Fix CLC rendering for mounts, optional overwrite and indented file content#14032shubham76-dev wants to merge 1 commit into
Conversation
…and indented file content
|
|
Welcome @shubham76-dev! |
|
Hi @shubham76-dev. 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. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
thanks for the PR @shubham76-dev , this is making sense to me but you will need to sign the CLA before we can proceed. /ok-to-test |
What this PR does / why we need it:
Three inputs that are valid in
KubeadmConfigrender broken Ignition for Flatcar nodes.1.
diskSetup.filesystems[].overwriteis optional, but was always rendered.Leaving it out writes
wipe_filesystem: <nil>and the render fails:The machine then gets no bootstrap data.
wipe_tablea few lines above already guards this with{{- with .Overwrite }};wipe_filesystemnow does the same.2. Mount unit names were not escaped for systemd.
mountpointNameonly replaced/with-. systemd also needs a-inside a path escaped as\x2d, otherwise it refuses to load the unit because the name does not matchWhere=.systemd-escape -p)/var/lib/testdirvar-lib-testdirvar-lib-testdir/mnt/data-diskmnt-data-diskmnt-data\x2ddisk/var/lib/etcd-datavar-lib-etcd-datavar-lib-etcd\x2ddata/var/lib/containerd/var-lib-containerd-var-lib-containerdThis one is silent: Ignition applies, the node boots and joins, the disk is just never mounted. Now
uses
unit.UnitNamePathEscape.3.
writeFilescontent starting with a space or a tab failed the render.The
inline:block scalar had no indentation indicator, so YAML took the indentation from the firstline of the content:
It is now
|2, so the indentation comes from the template instead of the data.github.com/coreos/go-systemd/v22was already an indirect dependency and is only promoted to direct.One test per case, each fails without the change. The existing
TestRendercases are untouched andstill pass, so configs that already worked render exactly the same.
Which issue(s) this PR fixes:
None.
/area bootstrap