From a4ba2a86bd56a76452c09d46d63257942c91be8d Mon Sep 17 00:00:00 2001 From: mikhail-klimko Date: Thu, 11 Jan 2024 13:04:00 +0300 Subject: [PATCH] add tests --- .../tests/deployment/container_test.yaml | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/charts/cf-common-test/tests/deployment/container_test.yaml b/charts/cf-common-test/tests/deployment/container_test.yaml index 5c62e89..82380b0 100644 --- a/charts/cf-common-test/tests/deployment/container_test.yaml +++ b/charts/cf-common-test/tests/deployment/container_test.yaml @@ -327,3 +327,79 @@ tests: - equal: path: spec.template.spec.containers[0].image value: myregistry.io/codefresh/cf-api:latest + + - it: Test main container TPL env without overrides + values: + - values.yaml + - values-tpl.yaml + set: + global: + tpl: value + asserts: + - equal: + path: spec.template.spec.containers[0].env[1].name + value: TPL_VAR_ONE + - equal: + path: spec.template.spec.containers[0].env[1].value + value: value + + - it: Test main container TPL env with overrides + values: + - values.yaml + - values-tpl.yaml + set: + global: + tpl: value + container: + env: + TPL_VAR_ONE: + valueFrom: + secretKeyRef: + name: some-secret-one + key: some-key-one + env: + TPL_VAR_TWO: + valueFrom: + secretKeyRef: + name: some-secret-two + key: some-key-two + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: TPL_VAR_ONE + valueFrom: + secretKeyRef: + name: some-secret-one + key: some-key-one + - contains: + path: spec.template.spec.containers[0].env + content: + name: TPL_VAR_TWO + valueFrom: + secretKeyRef: + name: some-secret-two + key: some-key-two + + - it: Test main container TPL env with overrides (backward compatibility) + values: + - values.yaml + - values-tpl.yaml + set: + global: + tpl: value + env: + TPL_VAR_ONE: + valueFrom: + secretKeyRef: + name: some-secret-one + key: some-key-one + asserts: + - contains: + path: spec.template.spec.containers[0].env + content: + name: TPL_VAR_ONE + valueFrom: + secretKeyRef: + name: some-secret-one + key: some-key-one \ No newline at end of file