Skip to content

Commit 6f3c09c

Browse files
authored
fix(chart): quote rendered helm args (#221)
* fix(chart): quote rendered helm args * docs: add quoted chart args changelog entry
1 parent ffd5fff commit 6f3c09c

4 files changed

Lines changed: 40 additions & 25 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,3 +689,6 @@ jobs:
689689

690690
- name: Helm lint
691691
run: helm lint charts/loki-vl-proxy/
692+
693+
- name: Helm template quoted args regression
694+
run: helm template loki-vl-proxy charts/loki-vl-proxy -f scripts/ci/helm-quoted-args-values.yaml >/dev/null

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Bug Fixes
11+
12+
- chart/helm: quote rendered container args in the chart deployment template so values containing JSON, commas, colons, or embedded delimiters survive Helm rendering unchanged instead of being split or reinterpreted by YAML parsing.
13+
14+
### Tests
15+
16+
- chart/ci: add a quoted-args Helm template regression case covering structured `extraArgs` values such as auth pairs, field-mapping JSON, and tenant limit JSON blobs.
17+
1018
## [1.10.0] - 2026-04-20
1119

1220
### Bug Fixes

charts/loki-vl-proxy/templates/deployment.yaml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -100,75 +100,75 @@ spec:
100100
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
101101
args:
102102
{{- range $key, $value := .Values.extraArgs }}
103-
- "-{{ $key }}={{ $value }}"
103+
- {{ printf "-%s=%v" $key $value | quote }}
104104
{{- end }}
105105
{{- if and (not (hasKey .Values.extraArgs "deployment-environment")) (ne (default "" (get $observability "deploymentEnvironment")) "") }}
106-
- "-deployment-environment={{ get $observability "deploymentEnvironment" }}"
106+
- {{ printf "-deployment-environment=%v" (get $observability "deploymentEnvironment") | quote }}
107107
{{- end }}
108108
{{- if and (not (hasKey .Values.extraArgs "otel-service-name")) (ne (default "" (get $observabilityOTEL "serviceName")) "") }}
109-
- "-otel-service-name={{ get $observabilityOTEL "serviceName" }}"
109+
- {{ printf "-otel-service-name=%v" (get $observabilityOTEL "serviceName") | quote }}
110110
{{- end }}
111111
{{- if and (not (hasKey .Values.extraArgs "otel-service-namespace")) (ne (default "" (get $observabilityOTEL "serviceNamespace")) "") }}
112-
- "-otel-service-namespace={{ get $observabilityOTEL "serviceNamespace" }}"
112+
- {{ printf "-otel-service-namespace=%v" (get $observabilityOTEL "serviceNamespace") | quote }}
113113
{{- end }}
114114
{{- if and (not (hasKey .Values.extraArgs "otel-service-instance-id")) (ne (default "" (get $observabilityOTEL "serviceInstanceId")) "") }}
115-
- "-otel-service-instance-id={{ get $observabilityOTEL "serviceInstanceId" }}"
115+
- {{ printf "-otel-service-instance-id=%v" (get $observabilityOTEL "serviceInstanceId") | quote }}
116116
{{- end }}
117117
{{- if and (not (hasKey .Values.extraArgs "otlp-endpoint")) (ne (default "" (get $observabilityOTLP "endpoint")) "") }}
118-
- "-otlp-endpoint={{ get $observabilityOTLP "endpoint" }}"
118+
- {{ printf "-otlp-endpoint=%v" (get $observabilityOTLP "endpoint") | quote }}
119119
{{- end }}
120120
{{- if and (not (hasKey .Values.extraArgs "otlp-interval")) (ne (default "" (get $observabilityOTLP "interval")) "") }}
121-
- "-otlp-interval={{ get $observabilityOTLP "interval" }}"
121+
- {{ printf "-otlp-interval=%v" (get $observabilityOTLP "interval") | quote }}
122122
{{- end }}
123123
{{- if and (not (hasKey .Values.extraArgs "otlp-compression")) (ne (default "" (get $observabilityOTLP "compression")) "") }}
124-
- "-otlp-compression={{ get $observabilityOTLP "compression" }}"
124+
- {{ printf "-otlp-compression=%v" (get $observabilityOTLP "compression") | quote }}
125125
{{- end }}
126126
{{- if and (not (hasKey .Values.extraArgs "otlp-timeout")) (ne (default "" (get $observabilityOTLP "timeout")) "") }}
127-
- "-otlp-timeout={{ get $observabilityOTLP "timeout" }}"
127+
- {{ printf "-otlp-timeout=%v" (get $observabilityOTLP "timeout") | quote }}
128128
{{- end }}
129129
{{- if and (not (hasKey .Values.extraArgs "otlp-headers")) (ne (default "" (get $observabilityOTLP "headers")) "") }}
130-
- "-otlp-headers={{ get $observabilityOTLP "headers" }}"
130+
- {{ printf "-otlp-headers=%v" (get $observabilityOTLP "headers") | quote }}
131131
{{- end }}
132132
{{- if not (hasKey .Values.extraArgs "otlp-tls-skip-verify") }}
133-
- "-otlp-tls-skip-verify={{ ternary "true" "false" (default false (get $observabilityOTLP "tlsSkipVerify")) }}"
133+
- {{ printf "-otlp-tls-skip-verify=%s" (ternary "true" "false" (default false (get $observabilityOTLP "tlsSkipVerify"))) | quote }}
134134
{{- end }}
135135
{{- if not (hasKey .Values.extraArgs "metrics.max-tenants") }}
136-
- "-metrics.max-tenants={{ default 256 (get $observabilityMetrics "maxTenants") }}"
136+
- {{ printf "-metrics.max-tenants=%v" (default 256 (get $observabilityMetrics "maxTenants")) | quote }}
137137
{{- end }}
138138
{{- if not (hasKey .Values.extraArgs "metrics.max-clients") }}
139-
- "-metrics.max-clients={{ default 256 (get $observabilityMetrics "maxClients") }}"
139+
- {{ printf "-metrics.max-clients=%v" (default 256 (get $observabilityMetrics "maxClients")) | quote }}
140140
{{- end }}
141141
{{- if not (hasKey .Values.extraArgs "metrics.trust-proxy-headers") }}
142-
- "-metrics.trust-proxy-headers={{ ternary "true" "false" (default false (get $observabilityMetrics "trustProxyHeaders")) }}"
142+
- {{ printf "-metrics.trust-proxy-headers=%s" (ternary "true" "false" (default false (get $observabilityMetrics "trustProxyHeaders"))) | quote }}
143143
{{- end }}
144144
{{- if not (hasKey .Values.extraArgs "metrics.export-sensitive-labels") }}
145-
- "-metrics.export-sensitive-labels={{ ternary "true" "false" (default false (get $observabilityMetrics "exportSensitiveLabels")) }}"
145+
- {{ printf "-metrics.export-sensitive-labels=%s" (ternary "true" "false" (default false (get $observabilityMetrics "exportSensitiveLabels"))) | quote }}
146146
{{- end }}
147147
{{- if not (hasKey .Values.extraArgs "server.register-instrumentation") }}
148-
- "-server.register-instrumentation={{ ternary "true" "false" (default true (get $observabilityServer "registerInstrumentation")) }}"
148+
- {{ printf "-server.register-instrumentation=%s" (ternary "true" "false" (default true (get $observabilityServer "registerInstrumentation"))) | quote }}
149149
{{- end }}
150150
{{- if not (hasKey .Values.extraArgs "server.metrics-max-concurrency") }}
151-
- "-server.metrics-max-concurrency={{ default 1 (get $observabilityServer "metricsMaxConcurrency") }}"
151+
- {{ printf "-server.metrics-max-concurrency=%v" (default 1 (get $observabilityServer "metricsMaxConcurrency")) | quote }}
152152
{{- end }}
153153
{{- if and $hostProcEnabled (not (hasKey .Values.extraArgs "proc-root")) }}
154-
- "-proc-root={{ $hostProcMountPath }}"
154+
- {{ printf "-proc-root=%s" $hostProcMountPath | quote }}
155155
{{- end }}
156156
{{- if and .Values.persistence.enabled (not (hasKey .Values.extraArgs "disk-cache-path")) }}
157-
- "-disk-cache-path={{ include "loki-vl-proxy.diskCachePath" . }}"
157+
- {{ printf "-disk-cache-path=%s" (include "loki-vl-proxy.diskCachePath" .) | quote }}
158158
{{- end }}
159159
{{- if and (gt (len .Values.patternsCustom.inline) 0) (not (hasKey .Values.extraArgs "patterns-custom")) }}
160-
- '-patterns-custom={{ toJson .Values.patternsCustom.inline }}'
160+
- {{ printf "-patterns-custom=%s" (toJson .Values.patternsCustom.inline) | quote }}
161161
{{- end }}
162162
{{- if and $customPatternsFileEnabled (not (hasKey .Values.extraArgs "patterns-custom-file")) }}
163-
- "-patterns-custom-file={{ $customPatternsFilePath }}"
163+
- {{ printf "-patterns-custom-file=%s" $customPatternsFilePath | quote }}
164164
{{- end }}
165165
{{- if .Values.peerCache.enabled }}
166-
- "-peer-self=$(POD_IP):3100"
167-
- "-peer-discovery={{ .Values.peerCache.discovery }}"
166+
- {{ "-peer-self=$(POD_IP):3100" | quote }}
167+
- {{ printf "-peer-discovery=%s" .Values.peerCache.discovery | quote }}
168168
{{- if eq .Values.peerCache.discovery "dns" }}
169-
- "-peer-dns={{ include "loki-vl-proxy.peerServiceName" . }}.{{ .Release.Namespace }}.svc.cluster.local"
169+
- {{ printf "-peer-dns=%s.%s.svc.cluster.local" (include "loki-vl-proxy.peerServiceName" .) .Release.Namespace | quote }}
170170
{{- else if eq .Values.peerCache.discovery "static" }}
171-
- "-peer-static={{ join "," .Values.peerCache.peers }}"
171+
- {{ printf "-peer-static=%s" (join "," .Values.peerCache.peers) | quote }}
172172
{{- end }}
173173
{{- end }}
174174
{{- if or .Values.peerCache.enabled .Values.env $goMemLimitValue $injectOTELFromPod }}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
extraArgs:
2+
backend-basic-auth: "user:pass"
3+
field-mapping: '[{"vl_field":"custom.field","loki_label":"custom_label"}]'
4+
tenant-default-limits: '{"query_timeout":"1m","max_query_series":500,"max_query_lookback":"0s"}'

0 commit comments

Comments
 (0)