-
Notifications
You must be signed in to change notification settings - Fork 24
talm template -I silently strips operator comments above modeline #178
Copy link
Copy link
Open
Labels
area/commandsIssues or PRs related to pkg/commands (CLI subcommands, flag parsing, root detection)Issues or PRs related to pkg/commands (CLI subcommands, flag parsing, root detection)area/templateIssues or PRs related to talm template (chart render, -I rewrite, --set/--values overlays)Issues or PRs related to talm template (chart render, -I rewrite, --set/--values overlays)kind/featureCategorizes issue or PR as related to a new featureCategorizes issue or PR as related to a new featurepriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to completeImportant over the long term, but may not be staffed and/or may need multiple releases to completetriage/acceptedIndicates an issue is ready to be actively worked onIndicates an issue is ready to be actively worked on
Metadata
Metadata
Assignees
Labels
area/commandsIssues or PRs related to pkg/commands (CLI subcommands, flag parsing, root detection)Issues or PRs related to pkg/commands (CLI subcommands, flag parsing, root detection)area/templateIssues or PRs related to talm template (chart render, -I rewrite, --set/--values overlays)Issues or PRs related to talm template (chart render, -I rewrite, --set/--values overlays)kind/featureCategorizes issue or PR as related to a new featureCategorizes issue or PR as related to a new featurepriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to completeImportant over the long term, but may not be staffed and/or may need multiple releases to completetriage/acceptedIndicates an issue is ready to be actively worked onIndicates an issue is ready to be actively worked on
Problem
talm template -I -f nodes/node.yamlrewrites the node file in place with the rendered chart output. Any operator-added prose comments above the modeline (project documentation, ticket links, "this node was reset on X for Y" notes) are silently lost —-Iis full overwrite, not merge.Documented behaviour by design (
-Iflag = rewrite), but the loss is silent: no warning, no count of stripped lines, no preserved-comment block. Operators trip on it regularly.Reproduction
Verified on the dev17 project: prose comments at the head of
nodes/node0.yaml(documenting the OCI / cozystack VIP arrangement) were stripped on the first-Irun. Backup restored fromgit.Expected — pick one
# ...lines before the talm modeline), prepending them back after rewrite.Warning: removed N lines of operator comments above the modeline. Use --no-strip-comments (TODO) to preserve.talm template -Ihelp and README so operators learn before they lose data.Option 1 is the most operator-friendly and small in scope (parse the first comment block, re-emit on output before the modeline).
Why this matters
The rewrite path runs unattended in CI / scripted flows; comment loss is invisible until git diff catches it. Operators who don't
git committhe change first lose the comments permanently.Surfaced during the dev17 manual test plan exercise.