Skip to content

talm upgrade rewrites install.image in every -f file but upgrades only the first file's nodes #244

Description

talm upgrade takes its node set from the modeline of the first -f file, but the post-upgrade write-back runs over the whole list:

configFile := filesToProcess[0]                          // nodes come from here
writeBackInstallImageToFiles(filesToProcess, targetImage) // every file is rewritten

So talm upgrade -f nodes/node0.yaml -f nodes/node1.yaml upgrades node0 and then rewrites machine.install.image in both bodies. node1.yaml ends up claiming an image node1 never ran, and the next talm apply merges that claim into its config.

That is the failure the write-back was built to prevent, inverted. The help text spells out the reasoning — "without this a follow-up talm apply would merge the stale install.image over the chart-rendered new value" — which is exactly what now happens to the nodes that were never touched.

Both halves are documented in the Long help as separate sentences and never reconciled. Before changing either, the -f list needs a decided meaning for upgrade: it is not the same as for apply, where the first file anchors and the rest are side-patches.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/commandsIssues or PRs related to pkg/commands (CLI subcommands, flag parsing, root detection)area/upgradeIssues or PRs related to talm upgrade flow (image extraction, post-upgrade verification)kind/bugCategorizes issue or PR as related to a bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions