From cea9afa2739cc8313c228af0d8e1fefd9a1e88a4 Mon Sep 17 00:00:00 2001 From: liam-lowe <56076876+liam-lowe@users.noreply.github.com> Date: Wed, 2 Sep 2026 14:19:34 -0700 Subject: [PATCH] Apply top-level configOverride keys in the Helm chart --- charts/s2s-proxy/templates/_helpers.tpl | 8 +++++++ charts/s2s-proxy/tests/configmap_test.yaml | 27 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/charts/s2s-proxy/templates/_helpers.tpl b/charts/s2s-proxy/templates/_helpers.tpl index d6b0b6c2..2da7b2b1 100644 --- a/charts/s2s-proxy/templates/_helpers.tpl +++ b/charts/s2s-proxy/templates/_helpers.tpl @@ -72,6 +72,14 @@ Merge default config with overrides {{- end }} {{- $_ := set $merged "clusterConnections" $mergedClusterConnections -}} +{{/* +Merge every other top-level key. Without this, only clusterConnections is written back and +everything else in configOverride is silently discarded. +deepCopy the source: sprig mergeOverwrite mutates its first argument, and the loop above already +writes defaults into .Values.configOverride.clusterConnections in place. +*/}} +{{- $merged = mergeOverwrite $merged (omit $overrides "clusterConnections" | deepCopy) -}} + {{- $merged | toYaml }} {{- end }} diff --git a/charts/s2s-proxy/tests/configmap_test.yaml b/charts/s2s-proxy/tests/configmap_test.yaml index ec2b8fa8..d0b7a51d 100644 --- a/charts/s2s-proxy/tests/configmap_test.yaml +++ b/charts/s2s-proxy/tests/configmap_test.yaml @@ -36,3 +36,30 @@ tests: pattern: |- muxAddressInfo: \s*address: addr:3333 + + # Before this merge, only clusterConnections was written back. + # Every other top-level key in configOverride was silently discarded. + # The binary decodes with KnownFields(true). + # A key that now lands has to be one it knows. + - it: should apply top-level configOverride keys + set: + configOverride: + metrics: + prometheus: + listenAddress: "0.0.0.0:9999" + clusterConnections: + - local: + tcpClient: + address: "frontend-other:2222" + asserts: + - matchRegex: + path: data["config.yaml"] + pattern: |- + prometheus: + \s*listenAddress: 0.0.0.0:9999 + # The clusterConnections merge is unaffected. + - matchRegex: + path: data["config.yaml"] + pattern: |- + tcpClient: + \s*address: frontend-other:2222