From 05fe741f7e78881096b6d41ef8d7ef1175c80446 Mon Sep 17 00:00:00 2001 From: Andrea Borghi <2493436+danduk82@users.noreply.github.com> Date: Thu, 2 May 2024 11:54:11 +0200 Subject: [PATCH] Add test for valueFrom type of env variable (#190) * Fix valueFrom type of env variable * Add test * Reset to valueFrom --- tests/expected.yaml | 16 ++++++++++++++++ tests/values.yaml | 5 +++++ 2 files changed, 21 insertions(+) diff --git a/tests/expected.yaml b/tests/expected.yaml index c61d814..274aead 100644 --- a/tests/expected.yaml +++ b/tests/expected.yaml @@ -506,6 +506,10 @@ spec: image: "camptocamp/custom-bb:latest" imagePullPolicy: IfNotPresent env: + - name: "APP_KUBERNETES_IO_COMPONENT" + valueFrom: + fieldRef: + fieldPath: metadata.labels['app.kubernetes.io/component'] - name: "JWT_SECRET_KEY" valueFrom: secretKeyRef: @@ -554,6 +558,10 @@ spec: image: "camptocamp/custom-bb:latest" imagePullPolicy: IfNotPresent env: + - name: "APP_KUBERNETES_IO_COMPONENT" + valueFrom: + fieldRef: + fieldPath: metadata.labels['app.kubernetes.io/component'] - name: "JWT_SECRET_KEY" valueFrom: secretKeyRef: @@ -661,6 +669,10 @@ spec: image: "camptocamp/custom-bb:latest" imagePullPolicy: IfNotPresent env: + - name: "APP_KUBERNETES_IO_COMPONENT" + valueFrom: + fieldRef: + fieldPath: metadata.labels['app.kubernetes.io/component'] - name: "JWT_SECRET_KEY" valueFrom: secretKeyRef: @@ -767,6 +779,10 @@ spec: image: "camptocamp/custom-bb:latest" imagePullPolicy: IfNotPresent env: + - name: "APP_KUBERNETES_IO_COMPONENT" + valueFrom: + fieldRef: + fieldPath: metadata.labels['app.kubernetes.io/component'] - name: "JWT_SECRET_KEY" valueFrom: secretKeyRef: diff --git a/tests/values.yaml b/tests/values.yaml index 4469a89..cc1628a 100644 --- a/tests/values.yaml +++ b/tests/values.yaml @@ -128,6 +128,11 @@ services: type: secret name: jwt-key-secret key: JWT_SECRET_KEY + APP_KUBERNETES_IO_COMPONENT: + type: valueFrom + valueFrom: + fieldRef: + fieldPath: "metadata.labels['app.kubernetes.io/component']" image: repository: camptocamp/custom-bb tag: latest