Skip to content

Commit

Permalink
fix: change template behaviour on env
Browse files Browse the repository at this point in the history
Signed-off-by: andreibe <[email protected]>
  • Loading branch information
andreibe24 committed Nov 26, 2024
1 parent dedad5f commit 6f4cd43
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contrib/charts/dragonfly/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,15 @@ containers:
{{- toYaml . | trim | nindent 6 }}
{{- end }}
{{- include "dragonfly.volumemounts" . | trim | nindent 4 }}
{{- if or .Values.passwordFromSecret.enable .Values.env }}
env:
{{- if .Values.passwordFromSecret.enable }}
{{- $appVersion := .Chart.AppVersion | trimPrefix "v" }}
{{- $imageTag := .Values.image.tag | trimPrefix "v" }}
{{- $effectiveVersion := $appVersion }}
{{- if and $imageTag (ne $imageTag "") }}
{{- $effectiveVersion = $imageTag }}
{{- end }}
env:
{{- if semverCompare ">=1.14.0" $effectiveVersion }}
- name: DFLY_requirepass
{{- else }}
Expand All @@ -117,6 +118,7 @@ containers:
{{- with .Values.env }}
{{- toYaml . | trim | nindent 6 }}
{{- end }}
{{- end }}
{{- with .Values.envFrom }}
envFrom:
{{- toYaml . | trim | nindent 6 }}
Expand Down

0 comments on commit 6f4cd43

Please sign in to comment.