Skip to content
Closed
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
4 changes: 2 additions & 2 deletions chart/templates/dag-processor/dag-processor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ spec:
{{ tpl (toYaml .Values.dagProcessor.waitForMigrations.env) $ | indent 12 }}
{{- end }}
{{- end }}
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
{{- if .Values.dags.gitSync.enabled }}
{{- include "git_sync_container" (dict "Values" .Values "is_init" "true") | nindent 8 }}
{{- end }}
{{- if .Values.dagProcessor.extraInitContainers }}
Expand Down Expand Up @@ -186,7 +186,7 @@ spec:
{{- else }}
{{- include "dag_processor_liveness_check_command" . | nindent 16 }}
{{- end }}
{{- if and (.Values.dags.gitSync.enabled) (not .Values.dags.persistence.enabled) }}
{{- if .Values.dags.gitSync.enabled }}
{{- include "git_sync_container" . | indent 8 }}
{{- end }}
{{- if .Values.dagProcessor.extraContainers }}
Expand Down
10 changes: 4 additions & 6 deletions tests/charts/test_dag_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ def test_dags_gitsync_sidecar_and_init_container(self):
c["name"] for c in jmespath.search("spec.template.spec.initContainers", docs[0])
]

def test_dags_gitsync_with_persistence_no_sidecar_or_init_container(self):
def test_dags_gitsync_with_persistence_sidecar_and_init_container(self):
docs = render_chart(
values={
"dagProcessor": {"enabled": True},
Expand All @@ -490,10 +490,8 @@ def test_dags_gitsync_with_persistence_no_sidecar_or_init_container(self):
show_only=["templates/dag-processor/dag-processor-deployment.yaml"],
)

# No gitsync sidecar or init container
assert "git-sync" not in [
c["name"] for c in jmespath.search("spec.template.spec.containers", docs[0])
]
assert "git-sync-init" not in [
# gitsync sidecar and init container should be created
assert "git-sync" in [c["name"] for c in jmespath.search("spec.template.spec.containers", docs[0])]
assert "git-sync-init" in [
c["name"] for c in jmespath.search("spec.template.spec.initContainers", docs[0])
]