Skip to content

Commit 0d224a0

Browse files
committed
fix(helm): quote proxy CA ConfigMap references
Signed-off-by: Philippe Martin <phmartin@redhat.com>
1 parent 49f2d31 commit 0d224a0

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

deploy/helm/openshell/templates/_gateway-workload.tpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,11 @@ spec:
278278
{{- if .Values.upstreamProxy.caBundle.configMapName }}
279279
- name: upstream-proxy-ca
280280
configMap:
281-
name: {{ .Values.upstreamProxy.caBundle.configMapName }}
281+
name: {{ .Values.upstreamProxy.caBundle.configMapName | quote }}
282282
items:
283283
# The mounted filename stays fixed so the rendered proxy_ca_bundle
284284
# path does not depend on the operator's ConfigMap key.
285-
- key: {{ .Values.upstreamProxy.caBundle.key | default "ca.crt" }}
285+
- key: {{ .Values.upstreamProxy.caBundle.key | default "ca.crt" | quote }}
286286
path: ca.crt
287287
{{- end }}
288288
{{- if .Values.server.providerTokenGrants.spiffe.enabled }}

deploy/helm/openshell/tests/gateway_upstream_proxy_ca_test.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,26 @@ tests:
7878
- key: ca-bundle.crt
7979
path: ca.crt
8080

81+
# Kubernetes requires both ConfigMap reference fields to be strings. Quote
82+
# numeric-looking operator values in the rendered workload so YAML does not
83+
# decode them as numbers before typed Kubernetes validation.
84+
- it: preserves numeric-looking ConfigMap references as strings
85+
template: templates/statefulset.yaml
86+
set:
87+
upstreamProxy.url: https://proxy.corp.example:3130
88+
upstreamProxy.caBundle.configMapName: "123"
89+
upstreamProxy.caBundle.key: "456"
90+
asserts:
91+
- contains:
92+
path: spec.template.spec.volumes
93+
content:
94+
name: upstream-proxy-ca
95+
configMap:
96+
name: "123"
97+
items:
98+
- key: "456"
99+
path: ca.crt
100+
81101
- it: adds no volume when no corporate proxy CA is configured
82102
template: templates/statefulset.yaml
83103
set:

0 commit comments

Comments
 (0)