Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart: configurable mountPath for DAGs volume #35083

Merged
merged 3 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions chart/templates/_helpers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,11 @@ server_tls_key_file = /etc/pgbouncer/server.key

{{- define "airflow_dags_mount" -}}
- name: dags
{{- if .Values.dags.mountPath }}
mountPath: {{ .Values.dags.mountPath }}
{{- else }}
mountPath: {{ printf "%s/dags" .Values.airflowHome }}
{{- end }}
{{- if .Values.dags.persistence.subPath }}
subPath: {{ .Values.dags.persistence.subPath }}
{{- end }}
Expand Down
8 changes: 8 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6931,6 +6931,14 @@
"x-docsSection": "Airflow",
"additionalProperties": false,
"properties": {
"mountPath": {
"description": "Where dags volume will be mounted. Works for both `persistence` and `gitSync`. If not specified, dags mount path will be set to `$AIRFLOW_HOME/dags`",
Aakcht marked this conversation as resolved.
Show resolved Hide resolved
"type": [
"string",
"null"
],
"default": null
},
"persistence": {
"description": "Persistence configuration.",
"type": "object",
Expand Down
3 changes: 3 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2351,6 +2351,9 @@ podTemplate: ~

# Git sync
dags:
# Where dags volume will be mounted. Works for both persistence and gitSync.
# If not specified, dags mount path will be set to $AIRFLOW_HOME/dags
mountPath: ~
persistence:
# Annotations for dags PVC
annotations: {}
Expand Down
16 changes: 16 additions & 0 deletions helm_tests/airflow_aux/test_airflow_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,22 @@ class TestAirflowCommon:
"readOnly": False,
},
),
(
{"mountPath": "/opt/airflow/dags/custom", "gitSync": {"enabled": True}},
{
"mountPath": "/opt/airflow/dags/custom",
"name": "dags",
"readOnly": True,
},
),
(
{"mountPath": "/opt/airflow/dags/custom", "persistence": {"enabled": True}},
{
"mountPath": "/opt/airflow/dags/custom",
"name": "dags",
"readOnly": False,
},
),
],
)
def test_dags_mount(self, dag_values, expected_mount):
Expand Down