Skip to content

Commit

Permalink
Conditionally set image pull policy depending on tag (#1461)
Browse files Browse the repository at this point in the history
  • Loading branch information
MauAraujo authored Jan 2, 2025
1 parent f5f8b2e commit d6534c7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion applications/job/templates/cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,12 @@ spec:
{{- if .Values.global }}
{{- if .Values.global.image }}
image: "{{ .Values.global.image.repository }}:{{ .Values.global.image.tag }}"
imagePullPolicy: {{ if eq .Values.global.image.tag "latest" }}"Always"{{ else }}"IfNotPresent"{{ end }}
{{- end }}
{{- else }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ if eq .Values.image.tag "latest" }}"Always"{{ else }}"IfNotPresent"{{ end }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.global }}
{{- if .Values.global.image }}
{{- if and .Values.container.command (not (eq .Values.global.image.repository "public.ecr.aws/o1j4x7p4/hello-porter")) }}
Expand Down
3 changes: 2 additions & 1 deletion applications/web/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,12 @@ spec:
{{- if .Values.global }}
{{- if .Values.global.image }}
image: "{{ .Values.global.image.repository }}:{{ .Values.global.image.tag }}"
imagePullPolicy: {{ if eq .Values.global.image.tag "latest" }}"Always"{{ else }}"IfNotPresent"{{ end }}
{{- end }}
{{- else }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ if eq .Values.image.tag "latest" }}"Always"{{ else }}"IfNotPresent"{{ end }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.global }}
{{- if .Values.global.image }}
{{- if and .Values.container.command (not (eq .Values.global.image.repository "public.ecr.aws/o1j4x7p4/hello-porter")) }}
Expand Down
3 changes: 2 additions & 1 deletion applications/worker/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ spec:
{{- if .Values.global }}
{{- if .Values.global.image }}
image: "{{ .Values.global.image.repository }}:{{ .Values.global.image.tag }}"
imagePullPolicy: {{ if eq .Values.global.image.tag "latest" }}"Always"{{ else }}"IfNotPresent"{{ end }}
{{- end }}
{{- else }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ if eq .Values.image.tag "latest" }}"Always"{{ else }}"IfNotPresent"{{ end }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- if .Values.global }}
{{- if .Values.global.image }}
{{- if and .Values.container.command (not (eq .Values.global.image.repository "public.ecr.aws/o1j4x7p4/hello-porter")) }}
Expand Down

0 comments on commit d6534c7

Please sign in to comment.