Skip to content

Commit

Permalink
chore: fix for POD_NAME and POD_NAMESPACE envs when enableHA is true
Browse files Browse the repository at this point in the history
  • Loading branch information
robgordon89 committed Aug 7, 2024
1 parent 12b9a19 commit 32d5ce8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ spec:
fieldRef:
fieldPath: {{ $value | quote}}
{{- end }}
{{- end }}
{{- if eq .Values.reloader.watchGlobally false }}
- name: KUBERNETES_NAMESPACE
valueFrom:
Expand All @@ -146,7 +147,6 @@ spec:
{{- if .Values.reloader.enableMetricsByNamespace }}
- name: METRICS_COUNT_BY_NAMESPACE
value: enabled
{{- end }}
{{- end }}
ports:
- name: http
Expand Down
13 changes: 13 additions & 0 deletions deployments/kubernetes/chart/reloader/tests/deployment_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,16 @@ tests:
asserts:
- isEmpty:
path: spec.template.spec.containers[0].securityContext

- it: template still sets POD_NAME and POD_NAMESPACE environment variables when enableHA is true
set:
reloader:
enableHA: true
asserts:
- contains:
path: spec.template.spec.containers[0].env
content:
name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name

0 comments on commit 32d5ce8

Please sign in to comment.