Skip to content

Commit

Permalink
Add test for valueFrom type of env variable (#190)
Browse files Browse the repository at this point in the history
* Fix valueFrom type of env variable

* Add test

* Reset to valueFrom
  • Loading branch information
danduk82 authored May 2, 2024
1 parent 3784900 commit 05fe741
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/expected.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions tests/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 05fe741

Please sign in to comment.