From 8014b31a9ea5339ac2ea459e7502bd865e120f8a Mon Sep 17 00:00:00 2001 From: jk464 Date: Thu, 8 Feb 2024 14:41:20 +0000 Subject: [PATCH 1/2] Add image pull policy to all containers --- templates/_helpers.tpl | 2 ++ templates/deployments.yaml | 1 + templates/jobs.yaml | 1 + 3 files changed, 4 insertions(+) diff --git a/templates/_helpers.tpl b/templates/_helpers.tpl index 4b98b21c..200fc7aa 100644 --- a/templates/_helpers.tpl +++ b/templates/_helpers.tpl @@ -196,6 +196,7 @@ Reduce duplication of the st2.*.conf volume details {{- $mongodb_port := (int (index .Values "mongodb" "service" "port")) }} - name: wait-for-db image: {{ template "stackstorm-ha.utilityImage" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} command: - 'sh' - '-c' @@ -216,6 +217,7 @@ Reduce duplication of the st2.*.conf volume details {{- $rabbitmq_port := (int (index .Values "rabbitmq" "service" "port")) }} - name: wait-for-queue image: {{ template "stackstorm-ha.utilityImage" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} command: - 'sh' - '-c' diff --git a/templates/deployments.yaml b/templates/deployments.yaml index 9620458a..687d04f6 100644 --- a/templates/deployments.yaml +++ b/templates/deployments.yaml @@ -1164,6 +1164,7 @@ spec: {{- if $some_sensors_per_pod }} - name: {{ $name }}-init-config image: '{{ template "stackstorm-ha.utilityImage" $ }}' + imagePullPolicy: {{ $.Values.image.pullPolicy }} volumeMounts: - name: st2-sensor-config-vol mountPath: /tmp/st2 diff --git a/templates/jobs.yaml b/templates/jobs.yaml index 3e77c179..6f421b3b 100644 --- a/templates/jobs.yaml +++ b/templates/jobs.yaml @@ -135,6 +135,7 @@ spec: {{- include "stackstorm-ha.init-containers-wait-for-db" . | nindent 6 }} - name: wait-for-api image: {{ template "stackstorm-ha.utilityImage" . }} + imagePullPolicy: {{ $.Values.image.pullPolicy }} {{- with .Values.securityContext }} securityContext: {{- toYaml . | nindent 10 }} {{- end }} From 6093a0a9ccf7ad906cfc941121c23549bc4a24c0 Mon Sep 17 00:00:00 2001 From: Jacob Floyd Date: Wed, 10 Apr 2024 22:17:09 -0500 Subject: [PATCH 2/2] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d8a2be78..e9d3a215 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ * Add securityContext support to custom st2packs images, extra_hooks jobs; Also fallback to st2actionrunner securityContext for misc init container jobs and pods. (#410) (by @cognifloyd) * Stop generating the DataStore Secret (#385) and checksum labels (#391) when existing secret provided or disabled (by @bmarick) * Stop generating the checksum labels for Auth Secret (#392) when existing secret provided or disabled (by @bmarick) +* Use `image.pullPolicy` for all containers including init containers that use `image.utilityImage`. (#397) (by @jk464) ## v1.0.0 * Bump to latest CircleCI orb versions (kubernetes@1.3.1 and helm@3.0.0 by @ZoeLeah)