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
feat(config): migrate to Talos v1.12 multi-document config format
Add support for the Talos v1.12 multi-document configuration format. When
TalosVersion is set to v1.12 or later (via Chart.yaml or --talos-version CLI
flag), templates generate separate YAML documents instead of the deprecated
monolithic machine.network and machine.registries fields.
Closes#100
Engine:
- Pass TalosVersion through the Helm values map into the template rendering
context (available as .TalosVersion), avoiding global mutable state
- Remove unused ctx and chrt parameters from applyPatchesAndRenderConfig
Chart templates (cozystack + generic):
- Split talos.config into shared sub-templates to eliminate duplication:
talos.config.machine.common, talos.config.cluster,
talos.config.network.legacy, talos.config.network.multidoc
- Version dispatcher selects legacy or multi-doc format based on semverCompare
- New v1.12 document types generated: HostnameConfig, ResolverConfig,
LinkConfig, BondConfig, VLANConfig, RegistryMirrorConfig, Layer2VIPConfig
Bug fix:
- Fix nr_hugepages rendering inside with block (was producing empty string
for non-zero values due to .Values being inaccessible when dot is rebound)
Backward compatibility:
- Legacy format is fully preserved when TalosVersion is empty or < v1.12
- All legacy regression tests pass unchanged
Tests:
- isTalosConfigPatch and extractExtraDocuments tests for all 7 new document
types
- Offline rendering tests for both charts x both roles x both formats
- Version edge cases: pre-release, two-component version strings
- Concurrent render test with race detector
- nr_hugepages rendering test for both legacy and multi-doc paths
- Regression test from #119 for offline lookup producing empty interface
Code style:
- Replace interface{} with any across engine package
- Use maps.Copy instead of range+assign loops
- Use range over int for simple counting loops
- Use strings.Repeat instead of += concatenation
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Copy file name to clipboardExpand all lines: README.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -116,6 +116,10 @@ cluster:
116
116
endpoint: https://192.168.0.1:6443
117
117
```
118
118
119
+
> **Note:** The output format depends on the Talos version configured in `Chart.yaml` (`templateOptions.talosVersion`) or via the `--talos-version` CLI flag.
120
+
> For Talos < v1.12, the output is a single YAML document with `machine.network` and `machine.registries` sections (as shown above).
121
+
> For Talos >= v1.12, the output uses the multi-document format with separate typed documents (`HostnameConfig`, `ResolverConfig`, `LinkConfig`, `BondConfig`, `VLANConfig`, `RegistryMirrorConfig`, `Layer2VIPConfig`) instead of the deprecated monolithic fields.
0 commit comments