PR #163 added render-time validation (ipIsValid helper + chart-side fail-fast block) for malformed floatingIP on the v1.12 multi-doc path. The legacy v1.11 path (talos.config.network.legacy define in both charts/cozystack/templates/_helpers.tpl and charts/generic/templates/_helpers.tpl) consumes .Values.floatingIP directly in the inline vip: block and in the $vipOverride predicate without going through ipIsValid.
Symptom
An operator with templateOptions.talosVersion: v1.11 and a typoed floatingIP (e.g. "10.0.0.300", a numeric YAML scalar like 192168, or any other shape that does not parse as an IP literal) gets an apply-time rejection from Talos instead of the render-time fail with the exact bad value. Same render-time-vs-apply-time argument the v1.12 path now relies on:
- render-time fail names the offending field and echoes the bad literal
- apply-time fail surfaces deep inside the Talos config controller with less context
The chart already has the building blocks (ipIsValid engine helper, the $fipStr/$fipIsSet coercion pattern landed in #163); the legacy path just doesn't use them.
Fix
Factor the validation into a shared partial (e.g. talm.validate_floatingIP) and include it from both talos.config.network.legacy and talos.config.network.multidoc. The partial does the toString coercion + the $fipIsSet check + the ipIsValid predicate + the friendly fail with the bad value.
Tests
Mirror the contract tests already added for the multi-doc path:
TestContract_NetworkLegacy_VIPFailsOnInvalidFloatingIP — string typo
TestContract_NetworkLegacy_VIPFailsOnNumericFloatingIP — numeric scalar
TestContract_NetworkLegacy_VIPFailsOnFalsyNonStringFloatingIP — bool false / numeric 0
TestContract_NetworkLegacy_VIPGracefulWhenFloatingIPNil — nil-safe path
References
PR #163 — multi-doc validation landed there; reviewer flagged the legacy-path gap explicitly as a follow-up.
PR #163 added render-time validation (
ipIsValidhelper + chart-side fail-fast block) for malformedfloatingIPon the v1.12 multi-doc path. The legacy v1.11 path (talos.config.network.legacydefine in bothcharts/cozystack/templates/_helpers.tplandcharts/generic/templates/_helpers.tpl) consumes.Values.floatingIPdirectly in the inlinevip:block and in the$vipOverridepredicate without going throughipIsValid.Symptom
An operator with
templateOptions.talosVersion: v1.11and a typoedfloatingIP(e.g."10.0.0.300", a numeric YAML scalar like192168, or any other shape that does not parse as an IP literal) gets an apply-time rejection from Talos instead of the render-time fail with the exact bad value. Same render-time-vs-apply-time argument the v1.12 path now relies on:The chart already has the building blocks (
ipIsValidengine helper, the$fipStr/$fipIsSetcoercion pattern landed in #163); the legacy path just doesn't use them.Fix
Factor the validation into a shared partial (e.g.
talm.validate_floatingIP) andincludeit from bothtalos.config.network.legacyandtalos.config.network.multidoc. The partial does the toString coercion + the$fipIsSetcheck + theipIsValidpredicate + the friendlyfailwith the bad value.Tests
Mirror the contract tests already added for the multi-doc path:
TestContract_NetworkLegacy_VIPFailsOnInvalidFloatingIP— string typoTestContract_NetworkLegacy_VIPFailsOnNumericFloatingIP— numeric scalarTestContract_NetworkLegacy_VIPFailsOnFalsyNonStringFloatingIP— bool false / numeric 0TestContract_NetworkLegacy_VIPGracefulWhenFloatingIPNil— nil-safe pathReferences
PR #163 — multi-doc validation landed there; reviewer flagged the legacy-path gap explicitly as a follow-up.