diff --git a/deploy/Chart/templates/controller/deployment.yaml b/deploy/Chart/templates/controller/deployment.yaml index ceae6bea95..9f3fe91a3a 100644 --- a/deploy/Chart/templates/controller/deployment.yaml +++ b/deploy/Chart/templates/controller/deployment.yaml @@ -59,7 +59,6 @@ spec: containers: - name: controller image: "{{ include "radius.image" (dict "image" .Values.controller.image "tag" (.Values.controller.tag | default .Values.global.imageTag | default $appversion) "global" .Values.global) }}" - imagePullPolicy: 'Always' args: - '--config-file' - '/etc/config/controller-config.yaml' @@ -132,4 +131,4 @@ spec: {{- if .Values.global.appendRootCA.cert }} - name: ssl-certs emptyDir: {} - {{- end }} \ No newline at end of file + {{- end }} diff --git a/deploy/Chart/templates/dashboard/deployment.yaml b/deploy/Chart/templates/dashboard/deployment.yaml index fd98b220cc..c473c77706 100644 --- a/deploy/Chart/templates/dashboard/deployment.yaml +++ b/deploy/Chart/templates/dashboard/deployment.yaml @@ -29,7 +29,6 @@ spec: containers: - name: dashboard image: "{{ include "radius.image" (dict "image" .Values.dashboard.image "tag" (.Values.dashboard.tag | default .Values.global.imageTag | default $appversion) "global" .Values.global) }}" - imagePullPolicy: Always env: - name: NODE_ENV value: {{ .Values.dashboard.nodeEnv | default "development" | quote }} diff --git a/deploy/Chart/templates/database/statefulset.yaml b/deploy/Chart/templates/database/statefulset.yaml index c8d0ce809a..db7679d9a1 100644 --- a/deploy/Chart/templates/database/statefulset.yaml +++ b/deploy/Chart/templates/database/statefulset.yaml @@ -31,7 +31,6 @@ spec: securityContext: allowPrivilegeEscalation: false image: "{{ include "radius.image" (dict "image" .Values.database.image "tag" (.Values.database.tag | default .Values.global.imageTag | default "latest") "global" .Values.global) }}" - imagePullPolicy: IfNotPresent resources: requests: memory: "{{ .Values.database.resources.requests.memory }}" diff --git a/deploy/Chart/templates/pre-upgrade/job.yaml b/deploy/Chart/templates/pre-upgrade/job.yaml index e3371aafa2..cea8962ab0 100644 --- a/deploy/Chart/templates/pre-upgrade/job.yaml +++ b/deploy/Chart/templates/pre-upgrade/job.yaml @@ -32,7 +32,6 @@ spec: containers: - name: pre-upgrade image: "{{ include "radius.image" (dict "image" .Values.preupgrade.image "tag" (.Values.preupgrade.tag | default .Values.global.imageTag | default $appversion) "global" .Values.global) }}" - imagePullPolicy: 'Always' env: - name: TARGET_VERSION value: "{{ .Values.preupgrade.targetVersion | default .Chart.AppVersion }}" @@ -70,4 +69,4 @@ spec: {{- toYaml .Values.preupgrade.securityContext | nindent 10 }} securityContext: {{- toYaml .Values.preupgrade.podSecurityContext | nindent 8 }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/deploy/Chart/tests/helpers_test.yaml b/deploy/Chart/tests/helpers_test.yaml index 4b4e98aba5..4a2fc55510 100644 --- a/deploy/Chart/tests/helpers_test.yaml +++ b/deploy/Chart/tests/helpers_test.yaml @@ -10,6 +10,7 @@ templates: - de/deployment.yaml - dashboard/deployment.yaml - database/statefulset.yaml + - pre-upgrade/job.yaml tests: - it: should use default ghcr.io registry when global.imageRegistry is not set set: @@ -324,6 +325,30 @@ tests: value: internal.registry.io/mirror/postgres:14-alpine template: database/statefulset.yaml + - it: should not set imagePullPolicy on chart-managed containers + templates: + - controller/deployment.yaml + - dashboard/deployment.yaml + - database/statefulset.yaml + - pre-upgrade/job.yaml + set: + dashboard.enabled: true + database.enabled: true + preupgrade.enabled: true + asserts: + - isNull: + path: spec.template.spec.containers[0].imagePullPolicy + template: controller/deployment.yaml + - isNull: + path: spec.template.spec.containers[0].imagePullPolicy + template: dashboard/deployment.yaml + - isNull: + path: spec.template.spec.containers[0].imagePullPolicy + template: database/statefulset.yaml + - isNull: + path: spec.template.spec.containers[0].imagePullPolicy + template: pre-upgrade/job.yaml + - it: should handle mixed scenario - some with full paths, some without set: global.imageRegistry: default-registry.io