Skip to content

fix(cmdline): keep the cmdline stages when one token cannot be converted - #5507

Merged
Itxaka merged 2 commits into
kairos-io:masterfrom
itxaka-agent:triage/dot-modifier-digit-key
Oct 20, 2026
Merged

Itxaka merged 2 commits into
kairos-io:masterfrom
itxaka-agent:triage/dot-modifier-digit-key

Conversation

@itxaka-agent

Copy link
Copy Markdown
Collaborator

Automated triage agent (kairos-triage-agent) running as @itxaka-agent.
This comment was generated by software. A human maintainer can override
any action taken here.

A kernel arg whose key starts with a digit, like 8250.nr_uarts=0, cannot be turned into YAML. DotStringToYAML skips it but still returns an error along with the rest, and yip's schema.Load treats any modifier error as fatal. So on a host with such an arg on its cmdline, every generic dot-notation stage set there (stages.initramfs[0]...) was dropped by run-stage and by immucore.

This adds machine.DotStringToYAMLBestEffort: the tokens that converted are kept, the skipped ones are passed to a callback, and the agent and immucore modifiers log them at debug level. When nothing converts the error is still returned. DotStringToYAML itself is unchanged.

Skipped tokens are logged at debug, not warn: 8250.nr_uarts=0 is a valid kernel parameter the user can't fix, and the modifier runs several times per run-stage, which runstage.go already handles by demoting cmdline errors.

Same root cause as #5505, which fixed collector.ParseCmdLine. This is the other half and is independent of it, branched from master. The new specs in agent, immucore and sdk/machine fail on master and pass here. In the container, the five SyncData specs in agent/pkg/utils fail on master too (no rsync in the image).

No linked issue.

Signed-off-by: itxaka-agent itxaka-agent@users.noreply.github.com

itxaka-agent and others added 2 commits October 16, 2026 09:59
…ing keys

Co-authored-by: Itxaka <itxakaserrano@gmail.com>
Signed-off-by: itxaka-agent <itxaka-agent@users.noreply.github.com>
A kernel parameter whose key starts with a digit, like 8250.nr_uarts=0, cannot be turned into YAML. DotStringToYAML skips it but still returns an error, and yip drops the whole cmdline config when a modifier errors, so every stage set on the cmdline was lost.

Add DotStringToYAMLBestEffort to sdk/machine and use it from the agent and immucore modifiers: the tokens that converted are kept and the skipped ones are logged at debug level, matching how runstage already treats cmdline noise. When nothing converts the error is still returned. DotStringToYAML is unchanged.

Co-authored-by: Itxaka <itxakaserrano@gmail.com>
Signed-off-by: itxaka-agent <itxaka-agent@users.noreply.github.com>
@Itxaka
Itxaka merged commit 13fbc0d into kairos-io:master Oct 20, 2026
22 checks passed
@github-project-automation github-project-automation Bot moved this from QA to Done âś… in đź§™Issue tracking board Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants