You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 44c6520
Browse filesBrowse the repository at this point in the historyBrowse files
fix(charts,commands): skip empty bond config and honor --endpoints in init
Two operator-visible bugs in the talm init / multidoc-render flow.
* charts: cozystack + generic presets emit BondConfig with empty
`links:` for any discovered link with `spec.kind == "bond"`. The
Talos link controller can auto-create a bond stub in COSI link
state before any operator configuration enslaves physical NICs
to it — the master link carries a `bondMaster` spec but no other
link has `slaveKind: bond` + `masterIndex` pointing at it.
Rendering the document under those conditions ships
`BondConfig{name: bond0, links: <empty>, bondMode: ...}` to
Talos, which rejects on apply with `BondConfig/bond0: at least
one link must be specified`. Skip the document when
`talm.discovered.bond_slaves` returns an empty list: a
discovered bond without enslaved links is a stub, not a
user-configured bond. An operator who intends a bond declares
its slaves via a per-node body overlay. Pattern mirrors the
existing fail-fast guardrail for VLAN-without-parent in the
same files; chose skip over fail-fast because the operator
does not control the Talos-side stub creation.
* commands: `talm init --endpoints X` silently wrote `127.0.0.1`
to the generated talosconfig. The assignment site at
init.go:598 hardcoded `defaultLocalEndpoint`, discarding the
operator's flag. Extract `resolveTalosconfigEndpoints`:
when `GlobalArgs.Endpoints` is non-empty, propagate; otherwise
fall back to the loopback placeholder (yaml requires a
non-empty endpoints list; operator edits after init in that
case). Helper returns a defensive copy so callers mutating the
talosconfig field do not alias the operator-visible
`GlobalArgs.Endpoints` across init invocations.
Tests:
- TestContract_NetworkMultidoc_BondWithoutSlaves_SkipsBondConfig
pins the cozystack-side bond-skip contract: rendered output
must contain neither `kind: BondConfig` nor `name: bond0`
when slaves is empty. Positive-shape assertions verify that
eth0 (non-enslaved, has an address) still emits as a
LinkConfig so a future guard regression swallowing all link
emission does not slip through.
- TestContract_NetworkMultidoc_BondWithoutSlaves_SkipsBondConfig_Generic
pins the generic-preset counterpart against the same shape.
- TestResolveTalosconfigEndpoints_{GlobalNonEmpty_UsesGlobal,
GlobalEmpty_UsesLoopbackFallback, ReturnsCopy,
MultipleEndpoints} pin the helper's four behaviour axes:
operator-supplied propagation, fallback shape, defensive
copy, multi-endpoint shape.
emptyBondTopologyLookup fixture mirrors bondTopologyLookup but
drops eth0/eth1 enslavement so talm.discovered.bond_slaves
returns an empty list — exactly the Talos auto-stub shape.
Existing TestContract_NetworkMultidoc_BondRendersBondConfig and
TestContract_NetworkMultidoc_BondSlavesNotEmittedAsLinkConfig
keep passing: slaves-present case unaffected.
Scope: covers both multidoc (v1.12+) presets cozystack + generic.
The legacy v1.11 nested form in charts/talm/templates/_helpers.tpl
::talm.discovered.bond_config exhibits the same empty-slaves
shape; deliberately out of scope because the multidoc presets are
where the reported reproduction lives and the legacy path has
different downstream test coverage. Follow up if 1.11 operators
hit this shape.
Signed-off-by: Aleksei Sviridkin <[email protected]>
0 commit comments