Skip to content

chart: legacy v1.11 render path skips floatingIP validation #164

Description

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/chartIssues or PRs related to charts/ (Chart.yaml, helpers, templates)kind/bugCategorizes issue or PR as related to a bugpriority/backlogGeneral backlog priority. Lower than priority/important-longterm

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions