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 6e914ea
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: charts/cozystack/templates/_helpers.tpl
+1-307Lines changed: 1 addition & 307 deletions
Original file line number
Diff line number
Diff line change
@@ -161,313 +161,7 @@ cluster:
161
161
162
162
{{- /* Shared network document generation for v1.12+ multi-doc format */ -}}
163
163
{{- define"talos.config.network.multidoc" }}
164
-
{{- /* Multi-doc format reconstructs network config from discovery resources.
165
-
Every configurable link on the node (physical NIC, bond, VLAN, bridge)
166
-
gets its own document so a multi-NIC node ends up with all NICs
167
-
configured rather than only the gateway-bearing one. The gateway-
168
-
link's IPv4 default-route gateway is emitted only on that link's
169
-
document; every other link gets its addresses without a default route.
170
-
MTU is surfaced when discovery reports a value so non-default-MTU
171
-
links (jumbo frames, GRE) survive a re-render.
172
-
173
-
existing_interfaces_configuration is not consulted here: v1.12 nodes
174
-
store network config in separate documents (LinkConfig, BondConfig,
175
-
VLANConfig), not in the legacy machine.network.interfaces field. The
176
-
guardrail below catches the upgrade case where a node was originally
177
-
bootstrapped on a chart that emitted the legacy schema and still
178
-
carries non-empty machine.network.interfaces[] in its running
179
-
MachineConfig — the renderer cannot translate those entries today
180
-
and would otherwise silently drop them on the next apply. */ -}}
181
-
{{- $legacyInterfaces:= include "talm.discovered.existing_interfaces_configuration". }}
182
-
{{- if$legacyInterfaces }}
183
-
{{- fail (printf"talm: the multi-doc renderer cannot translate legacy machine.network.interfaces[] from the running MachineConfig. Move the interfaces, vlans, and addresses below into per-node body overlays as v1.12 typed documents (LinkConfig, VLANConfig, BondConfig, RouteConfig) before re-running talm apply, or pin templateOptions.talosVersion to v1.11 in Chart.yaml until the translator lands.\n\nDetected legacy block:\n%s"$legacyInterfaces) }}
{{- /* Talos's link controller can auto-create a bond stub in COSI
326
-
link state before any operator configuration enslaves
327
-
physical NICs to it: the master link carries a bondMaster
328
-
spec but no other link has slaveKind: bond + masterIndex
329
-
pointing at it. Emitting BondConfig with empty `links:`
330
-
produces a document Talos rejects on apply ("at least one
331
-
link must be specified"). Treat empty-slaves as not-a-
332
-
user-bond and skip the document. An operator who intends
333
-
a bond must declare its slaves via a per-node body overlay;
334
-
until then the discovered stub is not promoted to config. */ -}}
335
-
{{- else }}
336
-
---
337
-
apiVersion: v1alpha1
338
-
kind: BondConfig
339
-
name: {{ $linkName }}
340
-
links:
341
-
{{- range$slaves }}
342
-
- {{ . }}
343
-
{{- end }}
344
-
{{- if$bondMaster }}
345
-
{{- if$bondMaster.mode }}
346
-
bondMode: {{ $bondMaster.mode }}
347
-
{{- end }}
348
-
{{- if$bondMaster.xmitHashPolicy }}
349
-
xmitHashPolicy: {{ $bondMaster.xmitHashPolicy }}
350
-
{{- end }}
351
-
{{- if$bondMaster.lacpRate }}
352
-
lacpRate: {{ $bondMaster.lacpRate }}
353
-
{{- end }}
354
-
{{- if$bondMaster.miimon }}
355
-
miimon: {{ $bondMaster.miimon }}
356
-
{{- end }}
357
-
{{- if$bondMaster.updelay }}
358
-
updelay: {{ $bondMaster.updelay }}
359
-
{{- end }}
360
-
{{- if$bondMaster.downdelay }}
361
-
downdelay: {{ $bondMaster.downdelay }}
362
-
{{- end }}
363
-
{{- end }}
364
-
{{- if$addresses }}
365
-
addresses:
366
-
{{- range$addresses }}
367
-
- address: {{ . }}
368
-
{{- end }}
369
-
{{- end }}
370
-
{{- if$linkGateway }}
371
-
routes:
372
-
- gateway: {{ $linkGateway }}
373
-
{{- end }}
374
-
{{- if$link.spec.mtu }}
375
-
mtu: {{ $link.spec.mtu }}
376
-
{{- end }}
377
-
{{- end }}
378
-
{{- elseifeq$kind"vlan" }}
379
-
{{- $parentLinkName:= include "talm.discovered.parent_link_name"$linkName }}
380
-
{{- $vlanID:= include "talm.discovered.vlan_id"$linkName }}
381
-
{{- ifnot$parentLinkName }}
382
-
{{- /* VLANConfig requires the parent field on the wire. Emitting one
383
-
without it produces a document Talos rejects on apply. Treat the
384
-
partial-discovery case as fail-fast — a VLAN with an unresolvable
385
-
linkIndex is a discovery bug, not a config we can render. */ -}}
386
-
{{- fail (printf"talm: discovered VLAN %q has no resolvable parent link (spec.linkIndex points at a non-existent link). VLANConfig requires the parent field; refusing to emit an invalid document. Fix the discovery state or declare the VLAN explicitly via a per-node body overlay."$linkName) }}
387
-
{{- end }}
388
-
{{- ifnot$vlanID }}
389
-
{{- /* VLANConfig also requires vlanID. Symmetric guardrail to the
390
-
missing-parent case above — discovery without spec.vlan.vlanID
391
-
cannot produce a valid VLANConfig. */ -}}
392
-
{{- fail (printf"talm: discovered VLAN %q has no resolvable vlanID (spec.vlan.vlanID is unset). VLANConfig requires vlanID; refusing to emit an invalid document. Fix the discovery state or declare the VLAN explicitly via a per-node body overlay."$linkName) }}
393
-
{{- end }}
394
-
---
395
-
apiVersion: v1alpha1
396
-
kind: VLANConfig
397
-
name: {{ $linkName }}
398
-
vlanID: {{ $vlanID }}
399
-
parent: {{ $parentLinkName }}
400
-
{{- if$addresses }}
401
-
addresses:
402
-
{{- range$addresses }}
403
-
- address: {{ . }}
404
-
{{- end }}
405
-
{{- end }}
406
-
{{- if$linkGateway }}
407
-
routes:
408
-
- gateway: {{ $linkGateway }}
409
-
{{- end }}
410
-
{{- if$link.spec.mtu }}
411
-
mtu: {{ $link.spec.mtu }}
412
-
{{- end }}
413
-
{{- else }}
414
-
---
415
-
apiVersion: v1alpha1
416
-
kind: LinkConfig
417
-
name: {{ $linkName }}
418
-
{{- if$addresses }}
419
-
addresses:
420
-
{{- range$addresses }}
421
-
- address: {{ . }}
422
-
{{- end }}
423
-
{{- end }}
424
-
{{- if$linkGateway }}
425
-
routes:
426
-
- gateway: {{ $linkGateway }}
427
-
{{- end }}
428
-
{{- if$link.spec.mtu }}
429
-
mtu: {{ $link.spec.mtu }}
430
-
{{- end }}
431
-
{{- end }}
432
-
{{- end }}
433
-
{{- end }}
434
-
{{- /* Discovery-derived Layer2VIPConfig: skipped when the operator
435
-
has set .Values.vipLink, since the override-path block above
436
-
has already emitted the document with the operator's chosen
437
-
link.
438
-
439
-
Link selection prefers the link whose discovered addresses
440
-
contain the floatingIP (talm.discovered.link_name_for_address),
441
-
so a VIP in a private subnet hosted on a VLAN child lands on
442
-
that VLAN — not on the IPv4-default-route NIC. The
443
-
default-gateway link stays as the fallback for topologies
444
-
where the VIP isn't on any discovered subnet (typical for
445
-
upstream-routable VIPs that arrive via the default-route
446
-
link). When neither resolves a link, no Layer2VIPConfig is
0 commit comments