Skip to content

Commit 7077de1

Browse files
fix(opentelemetry-kube-stack): quote env var values in Instrumentation template (#2155)
* fix(opentelemetry-kube-stack): quote env var values in Instrumentation template Numeric env var values passed to the Instrumentation resource caused validation errors because they were rendered as bare integers instead of strings. This is especially common when using the chart as a subchart, where YAML type coercion strips quotes from numeric strings. Two fixes: - Quote the value in the renderenvs template helper - Accept both string and number types in the EnvVar JSON schema Fixes #1888 Signed-off-by: Nick Nikolakakis <nonicked@protonmail.com> * fix: format JSON array for pre-commit pretty-format-json Signed-off-by: Nick Nikolakakis <nonicked@protonmail.com> --------- Signed-off-by: Nick Nikolakakis <nonicked@protonmail.com> Co-authored-by: Tyler Helmuth <12352919+TylerHelmuth@users.noreply.github.com>
1 parent 646b1b5 commit 7077de1

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

charts/opentelemetry-kube-stack/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: opentelemetry-kube-stack
3-
version: 0.14.11
3+
version: 0.14.12
44
description: |
55
OpenTelemetry Quickstart chart for Kubernetes.
66
Installs an operator and collector for an easy way to get started with Kubernetes observability.

charts/opentelemetry-kube-stack/templates/_helpers.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Render a deduped list of environment variables and 'extraEnvs'
7575
{{- end }}
7676
{{- range $key, $value := $envMap }}
7777
- name: {{ $key }}
78-
value: {{ $value }}
78+
value: {{ $value | quote }}
7979
{{- end }}
8080
{{- range $key, $value := $valueFromMap }}
8181
- name: {{ $key }}

charts/opentelemetry-kube-stack/values.schema.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,10 @@
566566
"type": "string"
567567
},
568568
"value": {
569-
"type": "string"
569+
"type": [
570+
"string",
571+
"number"
572+
]
570573
},
571574
"valueFrom": {
572575
"$ref": "#/$defs/EnvVarSource"

0 commit comments

Comments
 (0)