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(charts): emit BridgeConfig + gate default-route fallback on configurable set
Three CodeRabbit findings on the latest review, all of the same
class: VIP-link selection paths can pick links the chart does not
emit a per-link document for, leaving Layer2VIPConfig dangling.
Resolved by implementing BridgeConfig emission properly rather
than excluding bridges as a workaround:
1. bridge_slaves discovery helper: walks lookup "links" by
spec.slaveKind=="bridge" + spec.masterIndex, symmetric to
bond_slaves.
2. cozystack and generic charts: replace the prior "bridge as
gateway = fail, non-gateway bridge = silently skipped" branch
with a typed BridgeConfig emission carrying links (ports),
optional stp / vlan blocks from spec.bridgeMaster, plus the
shared addresses / routes / mtu shape. Bridges now behave like
bonds at render time.
3. Both charts: guard the default-route-link fallback in the
discovery-derived Layer2VIPConfig block on the same
configurable_link_names set the matched-link path uses.
Previously the fallback would happily promote a Wireguard /
slave / other unmanaged link if that was where the IPv4
default route sat.
Tests:
- TestContract_NetworkMultidoc_BridgeConfigEmitted: non-gateway
bridge yields a BridgeConfig document.
- TestMultiDocEmitsBridgeConfigWhenBridgeCarriesDefaultRoute:
gateway bridge now emits BridgeConfig + routes.gateway (was
a hard fail before).
- TestContract_Errors_MultidocBridgeAsGateway_NoLongerFails:
pins the negation of the prior fail-fast.
- TestContract_NetworkMultidoc_VIPOnBridge: VIP inside a bridge
subnet pins to that bridge (BridgeConfig + Layer2VIPConfig
co-emit, STP + ports verified).
- TestContract_NetworkMultidoc_VIPSkipsNonConfigurableDefaultRouteLink
plus generic mirror: default-route fallback honours the
configurable gate, no Layer2VIPConfig when the only resolvable
link is Wireguard.
The unimplemented-BridgeConfig migration hint at engine.go:181 and
its generic mirror are now obsolete — the gateway-bridge fail
above them no longer fires, the typed branch handles both
gateway and non-gateway cases uniformly.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Copy file name to clipboardExpand all lines: charts/cozystack/templates/_helpers.tpl
+54-11Lines changed: 54 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -249,17 +249,51 @@ link: {{ .Values.vipLink }}
249
249
{{- $linkGateway= include "talm.discovered.gateway_by_link"$linkName }}
250
250
{{- end }}
251
251
{{- ifeq$kind"bridge" }}
252
-
{{- /* BridgeConfig is a separate v1alpha1 typed document the chart
253
-
does not yet emit. Skipping a non-gateway bridge leaves the
254
-
rendered config without a bridge document and the operator is
255
-
responsible for declaring it via a per-node body. A bridge
256
-
carrying the IPv4 default route, however, cannot be silently
257
-
skipped: that would drop every network document for the
258
-
gateway link and the rendered config would describe a node
259
-
with no working uplink. Surface a fail with the offending
260
-
link and the migration path. */ -}}
261
-
{{- if$isGatewayLink }}
262
-
{{- fail (printf"talm: discovered bridge %q is the IPv4-default link, but BridgeConfig emission is not yet implemented in the chart. Move the bridge declaration into a per-node body overlay (kind: BridgeConfig), or set Values.vipLink to a different link until bridge support lands."$linkName) }}
252
+
{{- /* BridgeConfig emission. Discovers bridge ports (members) via
253
+
talm.discovered.bridge_slaves and emits a typed v1.12+
254
+
BridgeConfig document with the same address / route / mtu
255
+
shape as the other branches. STP and VLAN filtering are
256
+
opt-in: they are emitted only when the bridge controller
257
+
reported a non-nil spec.bridgeMaster.stp / spec.bridgeMaster
258
+
value, so a default-state bridge stays minimal. */ -}}
Copy file name to clipboardExpand all lines: charts/generic/templates/_helpers.tpl
+53-11Lines changed: 53 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -173,17 +173,51 @@ link: {{ .Values.vipLink }}
173
173
{{- $linkGateway= include "talm.discovered.gateway_by_link"$linkName }}
174
174
{{- end }}
175
175
{{- ifeq$kind"bridge" }}
176
-
{{- /* BridgeConfig is a separate v1alpha1 typed document the chart
177
-
does not yet emit. Skipping a non-gateway bridge leaves the
178
-
rendered config without a bridge document and the operator is
179
-
responsible for declaring it via a per-node body. A bridge
180
-
carrying the IPv4 default route, however, cannot be silently
181
-
skipped: that would drop every network document for the
182
-
gateway link and the rendered config would describe a node
183
-
with no working uplink. Surface a fail with the offending
184
-
link and the migration path. */ -}}
185
-
{{- if$isGatewayLink }}
186
-
{{- fail (printf"talm: discovered bridge %q is the IPv4-default link, but BridgeConfig emission is not yet implemented in the chart. Move the bridge declaration into a per-node body overlay (kind: BridgeConfig), or set Values.vipLink to a different link until bridge support lands."$linkName) }}
176
+
{{- /* BridgeConfig emission. Discovers bridge ports (members) via
177
+
talm.discovered.bridge_slaves and emits a typed v1.12+
178
+
BridgeConfig document with the same address / route / mtu
179
+
shape as the other branches. STP and VLAN filtering are
180
+
opt-in: they are emitted only when the bridge controller
181
+
reported a non-nil spec.bridgeMaster.stp / spec.bridgeMaster
182
+
value, so a default-state bridge stays minimal. */ -}}
0 commit comments