File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }}
Original file line number Diff line number Diff 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 :
You can’t perform that action at this time.
0 commit comments