Skip to content

🐛 Fix CLC rendering for mounts, optional overwrite and indented file content - #14032

Open
shubham76-dev wants to merge 1 commit into
kubernetes-sigs:mainfrom
shubham76-dev:fix-clc-ignition-rendering
Open

🐛 Fix CLC rendering for mounts, optional overwrite and indented file content#14032
shubham76-dev wants to merge 1 commit into
kubernetes-sigs:mainfrom
shubham76-dev:fix-clc-ignition-rendering

Conversation

@shubham76-dev

Copy link
Copy Markdown

What this PR does / why we need it:

Three inputs that are valid in KubeadmConfig render broken Ignition for Flatcar nodes.

1. diskSetup.filesystems[].overwrite is optional, but was always rendered.

Leaving it out writes wipe_filesystem: <nil> and the render fails:

error parsing Container Linux Config: error: yaml: unmarshal errors:
line 37: cannot unmarshal !!str `<nil>` into bool

The machine then gets no bootstrap data. wipe_table a few lines above already guards this with
{{- with .Overwrite }}; wipe_filesystem now does the same.

2. Mount unit names were not escaped for systemd.

mountpointName only replaced / with -. systemd also needs a - inside a path escaped as
\x2d, otherwise it refuses to load the unit because the name does not match Where=.

mount point before after (matches systemd-escape -p)
/var/lib/testdir var-lib-testdir var-lib-testdir
/mnt/data-disk mnt-data-disk mnt-data\x2ddisk
/var/lib/etcd-data var-lib-etcd-data var-lib-etcd\x2ddata
/var/lib/containerd/ var-lib-containerd- var-lib-containerd

This one is silent: Ignition applies, the node boots and joins, the disk is just never mounted. Now
uses unit.UnitNamePathEscape.

3. writeFiles content 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 first
line of the content:

"  foo: bar\nbaz: qux\n"  ->  yaml: line 25: did not find expected key
"\tfoo: bar\nbaz: qux\n"  ->  yaml: line 26: found a tab character where an indentation space is expected

It is now |2, so the indentation comes from the template instead of the data.

github.com/coreos/go-systemd/v22 was already an indirect dependency and is only promoted to direct.

One test per case, each fails without the change. The existing TestRender cases are untouched and
still pass, so configs that already worked render exactly the same.

Which issue(s) this PR fixes:

None.

/area bootstrap

Fix Ignition bootstrap rendering for mount paths that need systemd escaping, for `diskSetup.filesystems[].overwrite` when it is not set, and for `writeFiles` content whose first line is indented.

@kubernetes-prow kubernetes-prow Bot added the area/bootstrap Issues or PRs related to bootstrap providers label Aug 5, 2026
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@kubernetes-prow

Copy link
Copy Markdown
Contributor

Welcome @shubham76-dev!

It looks like this is your first PR to kubernetes-sigs/cluster-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow

Copy link
Copy Markdown
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@kubernetes-prow kubernetes-prow Bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 5, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign joelspeed for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Aug 5, 2026
@elmiko

elmiko commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

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

@kubernetes-prow kubernetes-prow Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/bootstrap Issues or PRs related to bootstrap providers cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants