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 06642ce
Browse filesBrowse the repository at this point in the historyBrowse files
fix(apply): refuse a node file that restores superseded fields
The render is checked for v1alpha1 fields the contract moved into typed
documents, but apply then lays the node file over it. A node file
rendered before the project moved to v1.14 still carries
machine.kubelet, cluster.clusterName and the rest, so the merged config
mixed both shapes and only the node rejected it, without talm's hint.
The merged config now goes through the same check before it is sent,
with a hint to re-render the node file with `talm template -I`.
The render-time hint names the way out that actually applies there. A
render never reads the node file's body, so re-rendering one fixes
nothing: unpinned, the charts write v1alpha1 on every contract and only
a pin helps; pinned at v1.14 or newer, the project's vendored templates
predate the typed documents and `talm init --update` re-syncs them.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <[email protected]>
Copy file name to clipboardExpand all lines: docs/configuration/talos-versions.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,12 +12,14 @@ Rather than emit that config, the render stops. With both keys empty the Kuberne
12
12
13
13
```text
14
14
rendered config mixes v1alpha1 fields with the documents that superseded them: ...
15
-
hint: templateOptions.talosVersion is unset, so the render targets the Talos version talm was built from.
16
-
Pin it to v1.13 or lower in Chart.yaml; above that contract Talos keeps these settings in documents of their own,
17
-
which the charts do not emit.
15
+
hint: templateOptions.talosVersion is unset, so the render targets the Talos version talm was built from; above v1.13
16
+
Talos keeps these settings in documents of their own, and the charts emit them only for a pinned version. Pin it
17
+
in Chart.yaml to the Talos version the nodes run, or to v1.13 or lower to keep the v1alpha1 shape.
18
18
```
19
19
20
-
A chart can also fail earlier than either guard: the cozystack preset deletes a default node label with `$patch: delete`, and on a contract where `machine.nodeLabels` has moved into `KubeNodeConfig` that path no longer exists, so patching stops with `failed to delete path ...: lookup failed` before any version check runs. The preset happens to pin `v1.12`, which predates that move and sidesteps it.
20
+
A project pinned at v1.14 or newer can hit the same error from its own templates: templates vendored by an earlier talm still write the v1alpha1 fields. The hint then points at `talm init --update --preset <preset>`, which re-syncs them; it also offers `Chart.yaml` and `values.yaml`, so review those changes before accepting them (see [Keeping charts in sync](../operations/upgrading.md)).
21
+
22
+
`talm apply` reports the conflict for a node file rendered before the project moved to v1.14, with a hint of its own: the file still carries `machine.kubelet`, `cluster.clusterName` and the rest, and laid over the v1.14 render they would reach the node as the mix it refuses. `talm template` alone does not catch it, because it renders from the templates and does not read the node file's body. `talm template -I` rewrites the file from the templates and keeps only its leading comments, so save any hand-written body first (per-node `LinkConfig` overlays, pinned settings), re-render, then put the saved settings back, moving v1alpha1 Kubernetes fields into the matching document.
21
23
22
24
Pin `templateOptions.talosVersion` in `Chart.yaml`, and keep it no newer than the Talos running on the node (see [Version compatibility](#version-compatibility)). Projects created from the shipped presets already carry a pin.
Copy file name to clipboardExpand all lines: docs/manual-test-plan.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -746,9 +746,11 @@ OIDC on cozystack: set `oidcIssuerUrl: https://issuer.example.com` and re-render
746
746
747
747
Refused flags, either preset: set `extraApiServerArgs: { oidc-issuer-url: x }` and re-render. Expected: the render fails naming `extraApiServerArgs.oidc-issuer-url` and pointing at `KubeAuthenticationConfig` or a pin at v1.13 or lower. The same key renders on a project pinned at v1.13.
748
748
749
+
Node files from an earlier contract, on a node running Talos v1.14: in a project pinned at `v1.13`, run `talm template -I --file nodes/<node>.yaml`, then set `talosVersion: "v1.14"` and `kubernetesVersion` to what the cluster runs, and run `talm apply --dry-run -f nodes/<node>.yaml`. Expected: the apply stops before contacting the node's apply API with `rendered config mixes v1alpha1 fields with the documents that superseded them`, naming the node file, and a hint to re-render with `talm template -I`. `talm template --file nodes/<node>.yaml` without `-I` succeeds at this point, since it does not read the node file's body. Run `talm template -I --file nodes/<node>.yaml`: the node file is rewritten in the v1.14 shape and the dry-run passes.
750
+
749
751
On a node running Talos v1.14 (any preset): `talm apply --dry-run -f nodes/<node>.yaml`, then apply. Expected: the drift preview lists `Kube*` documents rather than `cluster.*` fields, the node accepts the config, and `talm get kubeletconfig` / `talm get staticpods` show the kubelet and control-plane args from values. On cozystack, `kubectl get ds --namespace kube-system` lists neither `kube-flannel` nor `kube-proxy`, and control-plane nodes carry no `node-role.kubernetes.io/control-plane:NoSchedule` taint.
750
752
751
-
Regression anchor: `TestContract_ShippedChartsRenderValidConfig` loads both presets through the engine on v1.12, v1.13 and v1.14, at defaults and with every Kubernetes knob set, and validates the full render and the applied node file in machinery; `TestContract_ApiServerAuthFlagsRefusedFromV114` pins the refused flags; `TestContract_ChartKubeDocumentMergesIntoBundle`, `TestContract_ChartDeleteSelectorRemovesBundleDocument` and `TestContract_NonFullRenderKeepsChartKubeDocumentsVerbatim` pin the merge.
753
+
Regression anchor: `TestContract_ShippedChartsRenderValidConfig` loads both presets through the engine on v1.12, v1.13 and v1.14, at defaults and with every Kubernetes knob set, and validates the full render and the applied node file in machinery; `TestContract_ApiServerAuthFlagsRefusedFromV114` pins the refused flags; `TestApplyTemplatesPerNode_RefusesNodeFileWithSupersededFields` pins the apply-time check on an old node file; `TestContract_ChartKubeDocumentMergesIntoBundle`, `TestContract_ChartDeleteSelectorRemovesBundleDocument` and `TestContract_NonFullRenderKeepsChartKubeDocumentsVerbatim` pin the merge.
0 commit comments