-
Notifications
You must be signed in to change notification settings - Fork 25
chart: factor v1.12 multi-doc per-link branch into a named template #165
Copy link
Copy link
Closed
Labels
area/chartIssues or PRs related to charts/ (Chart.yaml, helpers, templates)Issues or PRs related to charts/ (Chart.yaml, helpers, templates)kind/cleanupCategorizes issue or PR as related to cleanup of code, process, or technical debtCategorizes issue or PR as related to cleanup of code, process, or technical debtpriority/backlogGeneral backlog priority. Lower than priority/important-longtermGeneral backlog priority. Lower than priority/important-longterm
Metadata
Metadata
Assignees
Labels
area/chartIssues or PRs related to charts/ (Chart.yaml, helpers, templates)Issues or PRs related to charts/ (Chart.yaml, helpers, templates)kind/cleanupCategorizes issue or PR as related to cleanup of code, process, or technical debtCategorizes issue or PR as related to cleanup of code, process, or technical debtpriority/backlogGeneral backlog priority. Lower than priority/important-longtermGeneral backlog priority. Lower than priority/important-longterm
Type
Fields
Give feedbackNo fields configured for issues without a type.
The per-link emission block in the v1.12 multi-doc network section — BondConfig / VLANConfig / BridgeConfig / LinkConfig branches, plus address stripping, plus gateway resolution — is duplicated byte-for-byte between
charts/cozystack/templates/_helpers.tplandcharts/generic/templates/_helpers.tpl. Around 250 lines in each chart. PR #163 carried this convention forward when adding the BridgeConfig branch, the longest-prefix VIP selector, and the floatingIP validation.Why it hurts
Every change to the multi-doc renderer has to be applied twice. Drift between the two charts is detectable only through the
*_Generic_*mirror tests inpkg/engine/contract_network_multidoc_test.go, which #163 expanded to cover every contract — but the mirror suite is a heuristic, not a structural guarantee. Future maintainers will have to keep adding mirrors for every new contract, or the partial symmetry will silently let one chart's hunk regress.Fix
Extract
talm.config.multidoc.per_linkintocharts/talm/templates/_helpers.tplandincludeit from both chart-specifictalos.config.network.multidocdefines. The cozystack-specificRegistryMirrorConfigemission stays where it is — only the per-link iteration body moves.Once factored:
*_Generic_*mirror tests in fix(charts): pin Layer2VIPConfig to subnet-matching link, not default route #163 stay as defensive coverage but become structural rather than load-bearing.Scope
The factor-out is mechanical —
git diff charts/cozystack/templates/_helpers.tpl charts/generic/templates/_helpers.tplalready shows the two blocks are identical. The only judgment call is the name of the shared partial and where it lives (talm chart vs a new shared file). Suggest the talm chart since other shared discovery helpers already live there.References
PR #163 — every reviewer iteration noted the duplication as non-blocking but worth a follow-up. Six
*_Generic_*mirror tests in #163 exist precisely to catch drift this issue would eliminate by construction.