This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 9a23b150aa Chart: add custom volumemounts to dag processor 
waitForMigrations (#30990)
9a23b150aa is described below

commit 9a23b150aa05fd3d1be9f75cd9a5162eced2b430
Author: Aakcht <[email protected]>
AuthorDate: Sat May 6 16:39:24 2023 +0300

    Chart: add custom volumemounts to dag processor waitForMigrations (#30990)
---
 chart/templates/dag-processor/dag-processor-deployment.yaml | 9 ++++++++-
 tests/charts/airflow_core/test_dag_processor.py             | 6 ++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/chart/templates/dag-processor/dag-processor-deployment.yaml 
b/chart/templates/dag-processor/dag-processor-deployment.yaml
index 4f8b84284e..d556da7bae 100644
--- a/chart/templates/dag-processor/dag-processor-deployment.yaml
+++ b/chart/templates/dag-processor/dag-processor-deployment.yaml
@@ -115,7 +115,14 @@ spec:
           resources: {{- toYaml .Values.dagProcessor.resources | nindent 12 }}
           image: {{ template "airflow_image_for_migrations" . }}
           imagePullPolicy: {{ .Values.images.airflow.pullPolicy }}
-          volumeMounts: {{- include "airflow_config_mount" . | nindent 12 }}
+          volumeMounts:
+            {{- if .Values.volumeMounts }}
+              {{- toYaml .Values.volumeMounts | nindent 12 }}
+            {{- end }}
+            {{- if .Values.dagProcessor.extraVolumeMounts }}
+              {{- toYaml .Values.dagProcessor.extraVolumeMounts | nindent 12 }}
+            {{- end }}
+            {{- include "airflow_config_mount" . | nindent 12 }}
           args: {{- include "wait-for-migrations-command" . | indent 10 }}
           envFrom: {{- include "custom_airflow_environment_from" . | default 
"\n  []" | indent 10 }}
           env:
diff --git a/tests/charts/airflow_core/test_dag_processor.py 
b/tests/charts/airflow_core/test_dag_processor.py
index def2523fc2..2b59cc0c34 100644
--- a/tests/charts/airflow_core/test_dag_processor.py
+++ b/tests/charts/airflow_core/test_dag_processor.py
@@ -118,6 +118,9 @@ class TestDagProcessor:
         assert "test-volume" == jmespath.search(
             "spec.template.spec.containers[0].volumeMounts[0].name", docs[0]
         )
+        assert "test-volume" == jmespath.search(
+            "spec.template.spec.initContainers[0].volumeMounts[0].name", 
docs[0]
+        )
 
     def test_should_add_global_volume_and_global_volume_mount(self):
         docs = render_chart(
@@ -133,6 +136,9 @@ class TestDagProcessor:
         assert "test-volume" == jmespath.search(
             "spec.template.spec.containers[0].volumeMounts[0].name", docs[0]
         )
+        assert "test-volume" == jmespath.search(
+            "spec.template.spec.initContainers[0].volumeMounts[0].name", 
docs[0]
+        )
 
     def test_should_add_extraEnvs(self):
         docs = render_chart(

Reply via email to