Skip to content

Commit df8c463

Browse files
committed
feat: add exclusion for all the gitsync containers if persistence is enabled
Signed-off-by: Burak Karakan <[email protected]>
1 parent af954b2 commit df8c463

18 files changed

+28
-28
lines changed

charts/airflow/files/pod_template.kubernetes-helm-yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ spec:
4848
{{- if $extraPipPackages }}
4949
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 4 }}
5050
{{- end }}
51-
{{- if .Values.dags.gitSync.enabled }}
51+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
5252
{{- include "airflow.container.git_sync" (dict "Release" .Release "Values" .Values "sync_one_time" "true") | indent 4 }}
5353
{{- end }}
5454
{{- if .Values.airflow.kubernetesPodTemplate.extraInitContainers }}

charts/airflow/templates/_helpers/pods.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ EXAMPLE USAGE: {{ include "airflow.volumes" (dict "Release" .Release "Values" .V
442442
{{- end }}
443443

444444
{{- /* git-sync */ -}}
445-
{{- if .Values.dags.gitSync.enabled }}
445+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
446446
{{- if .Values.dags.gitSync.sshSecret }}
447447
- name: git-secret
448448
secret:

charts/airflow/templates/_helpers/validate-values.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
{{- end }}
8585

8686
{{/* Checks for `dags.gitSync` */}}
87-
{{- if .Values.dags.gitSync.enabled }}
87+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
8888
{{- if not .Values.dags.gitSync.repo }}
8989
{{ required "If `dags.gitSync.enabled=true`, then `dags.gitSync.repo` must be non-empty!" nil }}
9090
{{- end }}

charts/airflow/templates/db-migrations/db-migrations-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ spec:
8282
{{- if $extraPipPackages }}
8383
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
8484
{{- end }}
85-
{{- if .Values.dags.gitSync.enabled }}
85+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
8686
## git-sync is included so "airflow plugins" & "python packages" can be stored in the dags repo
8787
{{- include "airflow.container.git_sync" (dict "Release" .Release "Values" .Values "sync_one_time" "true") | indent 8 }}
8888
{{- end }}
@@ -107,7 +107,7 @@ spec:
107107
- name: scripts
108108
mountPath: /mnt/scripts
109109
readOnly: true
110-
{{- if .Values.dags.gitSync.enabled }}
110+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
111111
## git-sync is included so "airflow plugins" & "python packages" can be stored in the dags repo
112112
{{- include "airflow.container.git_sync" . | indent 8 }}
113113
{{- end }}

charts/airflow/templates/db-migrations/db-migrations-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ spec:
7676
{{- if $extraPipPackages }}
7777
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
7878
{{- end }}
79-
{{- if .Values.dags.gitSync.enabled }}
79+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
8080
## git-sync is included so "airflow plugins" & "python packages" can be stored in the dags repo
8181
{{- include "airflow.container.git_sync" (dict "Release" .Release "Values" .Values "sync_one_time" "true") | indent 8 }}
8282
{{- end }}

charts/airflow/templates/flower/flower-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ spec:
8686
{{- if $extraPipPackages }}
8787
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
8888
{{- end }}
89-
{{- if .Values.dags.gitSync.enabled }}
89+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
9090
## git-sync is included so "airflow plugins" & "python packages" can be stored in the dags repo
9191
{{- include "airflow.container.git_sync" (dict "Release" .Release "Values" .Values "sync_one_time" "true") | indent 8 }}
9292
{{- end }}
@@ -151,7 +151,7 @@ spec:
151151
volumeMounts:
152152
{{- $volumeMounts | indent 12 }}
153153
{{- end }}
154-
{{- if .Values.dags.gitSync.enabled }}
154+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
155155
## git-sync is included so "airflow plugins" & "python packages" can be stored in the dags repo
156156
{{- include "airflow.container.git_sync" . | indent 8 }}
157157
{{- end }}

charts/airflow/templates/scheduler/scheduler-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ spec:
9494
{{- if $extraPipPackages }}
9595
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
9696
{{- end }}
97-
{{- if .Values.dags.gitSync.enabled }}
97+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
9898
{{- include "airflow.container.git_sync" (dict "Release" .Release "Values" .Values "sync_one_time" "true") | indent 8 }}
9999
{{- end }}
100100
{{- include "airflow.init_container.check_db" (dict "Release" .Release "Values" .Values "volumeMounts" $volumeMounts) | indent 8 }}
@@ -196,7 +196,7 @@ spec:
196196
readOnly: true
197197
{{- end }}
198198
{{- end }}
199-
{{- if .Values.dags.gitSync.enabled }}
199+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
200200
{{- include "airflow.container.git_sync" . | indent 8 }}
201201
{{- end }}
202202
{{- if .Values.scheduler.logCleanup.enabled }}

charts/airflow/templates/sync/sync-connections-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ spec:
8282
{{- if $extraPipPackages }}
8383
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
8484
{{- end }}
85-
{{- if .Values.dags.gitSync.enabled }}
85+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
8686
## git-sync is included so "airflow plugins" & "python packages" can be stored in the dags repo
8787
{{- include "airflow.container.git_sync" (dict "Release" .Release "Values" .Values "sync_one_time" "true") | indent 8 }}
8888
{{- end }}
@@ -113,7 +113,7 @@ spec:
113113
mountPath: "/mnt/templates"
114114
readOnly: true
115115
{{- end }}
116-
{{- if .Values.dags.gitSync.enabled }}
116+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
117117
## git-sync is included so "airflow plugins" & "python packages" can be stored in the dags repo
118118
{{- include "airflow.container.git_sync" . | indent 8 }}
119119
{{- end }}

charts/airflow/templates/sync/sync-connections-job.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ spec:
7676
{{- if $extraPipPackages }}
7777
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
7878
{{- end }}
79-
{{- if .Values.dags.gitSync.enabled }}
79+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
8080
## git-sync is included so "airflow plugins" & "python packages" can be stored in the dags repo
8181
{{- include "airflow.container.git_sync" (dict "Release" .Release "Values" .Values "sync_one_time" "true") | indent 8 }}
8282
{{- end }}

charts/airflow/templates/sync/sync-pools-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ spec:
8282
{{- if $extraPipPackages }}
8383
{{- include "airflow.init_container.install_pip_packages" (dict "Release" .Release "Values" .Values "extraPipPackages" $extraPipPackages) | indent 8 }}
8484
{{- end }}
85-
{{- if .Values.dags.gitSync.enabled }}
85+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
8686
## git-sync is included so "airflow plugins" & "python packages" can be stored in the dags repo
8787
{{- include "airflow.container.git_sync" (dict "Release" .Release "Values" .Values "sync_one_time" "true") | indent 8 }}
8888
{{- end }}
@@ -108,7 +108,7 @@ spec:
108108
- name: scripts
109109
mountPath: /mnt/scripts
110110
readOnly: true
111-
{{- if .Values.dags.gitSync.enabled }}
111+
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
112112
## git-sync is included so "airflow plugins" & "python packages" can be stored in the dags repo
113113
{{- include "airflow.container.git_sync" . | indent 8 }}
114114
{{- end }}

0 commit comments

Comments
 (0)