Skip to content

fix(opentelemetry-kube-stack): quote env var values in Instrumentation template - #2155

Merged
TylerHelmuth merged 3 commits into
open-telemetry:mainfrom
nicknikolakakis:fix/1888-instrumentation-env-numeric-values
Apr 22, 2026
Merged

fix(opentelemetry-kube-stack): quote env var values in Instrumentation template#2155
TylerHelmuth merged 3 commits into
open-telemetry:mainfrom
nicknikolakakis:fix/1888-instrumentation-env-numeric-values

Conversation

@nicknikolakakis

Copy link
Copy Markdown
Contributor

Fixes #1888

Summary

Numeric env var values (e.g. value: 4317) passed to the Instrumentation resource caused validation errors:

spec.env[1].value: Invalid value: "integer": spec.env[1].value in body must be of type string

This is especially common when using the chart as a subchart, where YAML type coercion strips quotes from numeric strings.

Changes

  • templates/_helpers.tpl: Added | quote to the value output in the renderenvs helper, ensuring all values are rendered as quoted strings
  • values.schema.json: Changed the EnvVar.value type from "string" to ["string", "number"] so numeric values pass schema validation before the template quotes them
  • Chart.yaml: Version bump 0.14.11 -> 0.14.12

Testing

  • helm template with integer env var values renders them as quoted strings
  • helm template with string env var values still works correctly

…n 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 open-telemetry#1888

Signed-off-by: Nick Nikolakakis <nonicked@protonmail.com>
@nicknikolakakis
nicknikolakakis requested review from a team and jaronoff97 as code owners April 18, 2026 05:49
@TylerHelmuth
TylerHelmuth merged commit 7077de1 into open-telemetry:main Apr 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[otel-kube-stack] Failure to use numeric values in Instrumentation env vars: Invalid value: "integer

2 participants