diff --git a/chart/files/pod-template-file.kubernetes-helm-yaml b/chart/files/pod-template-file.kubernetes-helm-yaml index 35b2b382ecf99..f59af3d0ea6cd 100644 --- a/chart/files/pod-template-file.kubernetes-helm-yaml +++ b/chart/files/pod-template-file.kubernetes-helm-yaml @@ -60,7 +60,7 @@ spec: {{- include "custom_airflow_environment" . | indent 6 }} {{- include "container_extra_envs" (list . .Values.workers.env) | indent 6 }} image: {{ template "pod_template_image" . }} - imagePullPolicy: {{ .Values.images.airflow.pullPolicy }} + imagePullPolicy: {{ .Values.images.pod_template.pullPolicy }} name: base resources: {{ toYaml .Values.workers.resources | indent 8 }} diff --git a/tests/charts/test_pod_template_file.py b/tests/charts/test_pod_template_file.py index 23797b4821621..581f7acd61664 100644 --- a/tests/charts/test_pod_template_file.py +++ b/tests/charts/test_pod_template_file.py @@ -280,13 +280,14 @@ def test_logs_persistence_changes_volume(self, log_persistence_values, expected) def test_should_set_a_custom_image_in_pod_template(self): docs = render_chart( - values={"images": {"pod_template": {"repository": "dummy_image", "tag": "latest"}}}, + values={"images": {"pod_template": {"repository": "dummy_image", "tag": "latest", "pullPolicy": "Always"}}}, show_only=["templates/pod-template-file.yaml"], chart_dir=self.temp_chart_dir, ) assert re.search("Pod", docs[0]["kind"]) assert "dummy_image:latest" == jmespath.search("spec.containers[0].image", docs[0]) + assert "Always" == jmespath.search("spec.containers[0].imagePullPolicy", docs[0]) assert "base" == jmespath.search("spec.containers[0].name", docs[0]) def test_mount_airflow_cfg(self):