diff --git a/library/common-test/tests/container/env_test.yaml b/library/common-test/tests/container/env_test.yaml index 404ba3bb8f..f51d1afc6c 100644 --- a/library/common-test/tests/container/env_test.yaml +++ b/library/common-test/tests/container/env_test.yaml @@ -65,6 +65,7 @@ tests: fieldRef: fieldPath: metadata.name VAR8: "" + VAR9: false asserts: - documentIndex: &deploymentDoc 2 isKind: @@ -134,6 +135,12 @@ tests: content: name: VAR8 value: "" + - documentIndex: *deploymentDoc + contains: + path: spec.template.spec.containers[0].env + content: + name: VAR9 + value: "false" # Failures - it: it should fail invalid ref diff --git a/library/common/Chart.yaml b/library/common/Chart.yaml index abc71d9ca0..300eff1a02 100644 --- a/library/common/Chart.yaml +++ b/library/common/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: common description: A library chart for iX Official Catalog type: library -version: 1.0.4 +version: 1.0.5 appVersion: v1 annotations: title: Common Library Chart diff --git a/library/common/templates/lib/container/_env.tpl b/library/common/templates/lib/container/_env.tpl index 028ca45972..8d2dcbf663 100644 --- a/library/common/templates/lib/container/_env.tpl +++ b/library/common/templates/lib/container/_env.tpl @@ -13,7 +13,8 @@ objectData: The object data to be used to render the container. - name: {{ $k | quote }} {{- if not (kindIs "map" $v) -}} {{- $value := "" -}} - {{- if $v -}} {{/* Only tpl non-empty values */}} + {{/* Only tpl valid values, there are cases that empty values after merges can be "" */}} + {{- if not (kindIs "invalid" $v) -}} {{- $value = tpl (toString $v) $rootCtx -}} {{- end }} value: {{ $value | quote }}