From 558ad86c1f3a83f1e5f0c8194ae165469c22e1a6 Mon Sep 17 00:00:00 2001 From: Schnitzel Date: Wed, 2 Sep 2026 22:06:17 -0400 Subject: [PATCH] fix(helm): gate the DD_* env-vars test on those values being set templates/tests/test-env-vars.yaml is a helm.sh/hook: test pod that asserts DD_ENV == dev_helm, DD_SERVICE == litellm and USE_DDTRACE == true, reading them from .Values.envVars. Those values are only set in ci/test-values.yaml, which the chart's own CircleCI job uses. values.yaml defaults envVars to {}, so on every real install that doesn't set the Datadog env vars, `helm test ` fails with "Environment variable DD_ENV mismatch. Expected: dev_helm, Got: ", and since helm stops at the first failed test, it also masks the useful test-connection test. Render the pod only when all three values are actually set. CI behavior is unchanged since ci/test-values.yaml sets them. --- helm/litellm-helm/templates/tests/test-env-vars.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helm/litellm-helm/templates/tests/test-env-vars.yaml b/helm/litellm-helm/templates/tests/test-env-vars.yaml index 9f0277557a4..19be9a0b4eb 100644 --- a/helm/litellm-helm/templates/tests/test-env-vars.yaml +++ b/helm/litellm-helm/templates/tests/test-env-vars.yaml @@ -1,3 +1,5 @@ +{{- $envVars := .Values.envVars | default dict }} +{{- if and $envVars.DD_ENV $envVars.DD_SERVICE $envVars.USE_DDTRACE }} apiVersion: v1 kind: Pod metadata: @@ -40,4 +42,5 @@ spec: value: {{ .Values.envVars.DD_SERVICE | quote }} - name: USE_DDTRACE value: {{ .Values.envVars.USE_DDTRACE | quote }} - restartPolicy: Never \ No newline at end of file + restartPolicy: Never +{{- end -}} \ No newline at end of file