Skip to content

Commit ccc9c43

Browse files
committed
Support env vars
1 parent 375f05b commit ccc9c43

File tree

5 files changed

+32
-1
lines changed

5 files changed

+32
-1
lines changed

charts/nhi-explorer/.helmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@
2424

2525
tests/
2626
test_values.yaml
27+
examples/

charts/nhi-explorer/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type: application
1616
# This is the chart version. This version number should be incremented each time you make changes
1717
# to the chart and its templates, including the app version.
1818
# Versions are expected to follow Semantic Versioning (https://semver.org/)
19-
version: 0.1.0
19+
version: 0.1.1
2020

2121
# This is the version number of the application being deployed. This version number should be
2222
# incremented each time you make changes to the application. Versions are not expected to

charts/nhi-explorer/templates/cronjob.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,16 @@ spec:
2424
securityContext: {{ toJson .Values.securityContext }}
2525
image: "{{ .Values.image.repository }}:{{ .Values.inventory.version }}"
2626
imagePullPolicy: {{ .Values.image.pullPolicy }}
27+
args:
28+
- from-config
2729
resources: {{ toJson .Values.resources }}
30+
envFrom: {{ toJson .Values.envFrom }}
2831
env:
2932
- name: INVENTORY_CONFIG_PATH
3033
value: /etc/inventory/config.yml
34+
{{- range .Values.env }}
35+
- {{ toJson . }}
36+
{{- end }}
3137
volumeMounts:
3238
- name: config
3339
mountPath: /etc/inventory

charts/nhi-explorer/tests/cronjob_test.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,23 @@ tests:
7676
content:
7777
name: INVENTORY_CONFIG_PATH
7878
value: /etc/inventory/config.yml
79+
80+
- it: should set env and envFrom
81+
set:
82+
envFrom:
83+
- secretRef:
84+
name: my-secret
85+
env:
86+
- name: foo
87+
value: bar
88+
asserts:
89+
- contains:
90+
path: spec.jobTemplate.spec.template.spec.containers[0].envFrom
91+
content:
92+
secretRef:
93+
name: my-secret
94+
- contains:
95+
path: spec.jobTemplate.spec.template.spec.containers[0].env
96+
content:
97+
name: foo
98+
value: bar

charts/nhi-explorer/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ imagePullSecrets: []
2424
nameOverride: ''
2525
fullnameOverride: ''
2626

27+
28+
env: []
29+
envFrom: []
30+
2731
# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
2832
serviceAccount:
2933
# Specifies whether a service account should be created

0 commit comments

Comments
 (0)