Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions chart/templates/_helpers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,9 @@
subPath: known_hosts
{{- end }}
{{- end }}
{{- if and .Values.dags.gitSync.enabled .Values.dags.gitSync.extraVolumeMounts }}
{{ toYaml .Values.dags.gitSync.extraVolumeMounts | indent 2 }}
{{- end }}
{{- end }}

# This helper will change when customers deploy a new image.
Expand Down
27 changes: 27 additions & 0 deletions chart/tests/test_git_sync_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,30 @@ def test_should_add_extra_volume_and_extra_volume_mount(self):
assert {"name": "test-volume", "mountPath": "/opt/test"} in jmespath.search(
"spec.template.spec.containers[0].volumeMounts", docs[0]
)

def test_extra_volume_and_git_sync_extra_volume_mount(self):
docs = render_chart(
values={
"executor": "CeleryExecutor",
"scheduler": {
"extraVolumes": [{"name": "test-volume", "emptyDir": {}}],
},
"dags": {
"gitSync": {
"enabled": True,
"extraVolumeMounts": [{"mountPath": "/opt/test", "name": "test-volume"}],
}
},
},
show_only=["templates/scheduler/scheduler-deployment.yaml"],
)

assert {"name": "test-volume", "emptyDir": {}} in jmespath.search(
"spec.template.spec.volumes", docs[0]
)
assert {'mountPath': '/git', 'name': 'dags'} in jmespath.search(
"spec.template.spec.containers[1].volumeMounts", docs[0]
)
assert {"name": "test-volume", "mountPath": "/opt/test"} in jmespath.search(
"spec.template.spec.containers[1].volumeMounts", docs[0]
)
4 changes: 4 additions & 0 deletions chart/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,10 @@
"description": "Git sync container run as user parameter.",
"type": "integer"
},
"extraVolumeMounts": {
"description": "Mount additional volumes into git sync container.",
"type": "array"
},
"credentialsSecret": {
"description": "TODO",
"type": ["string", "null"]
Expand Down
1 change: 1 addition & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -838,3 +838,4 @@ dags:
wait: 60
containerName: git-sync
uid: 65533
extraVolumeMounts: []