Skip to content

talm apply with templates rejects multi-node modelines in online rendering #120

@lexfrei

Description

@lexfrei

Context

PR #119 moved template rendering in talm apply from offline to online mode (rendering inside the Talos client callback so lookup() resolves real discovery data). This fixes the reported Talos v1.12 validation error, but introduces a behavioral change for multi-node modelines.

Problem

engine.Render calls helpers.FailIfMultiNodes (pkg/engine/engine.go:210) whenever Offline=false. Previously, talm apply rendered offline, so this check never fired, and the subsequent ApplyConfiguration gRPC call handled multi-node fan-out at the wire level.

After #119, users who:

  • put multiple IPs in a single modeline nodes=[ip1, ip2], or
  • pass --nodes ip1,ip2 on the command line

will hit FailIfMultiNodes before any rendering happens, in non-insecure mode.

Unaffected paths

  • The documented single-node-per-file flow (-f node1.yaml -f node2.yaml) still works because each file modeline sets exactly one node.
  • Maintenance mode (-i) still works because WithClientMaintenance does not inject nodes metadata into the gRPC context.

Proposed fix

Decide intent and apply one of:

  • Document the single-node-per-file convention explicitly in README.
  • Render once per node in the client callback when multiple nodes are present.
  • Reject multi-node modelines up front with a clearer error message explaining the constraint.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions