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
7 changes: 5 additions & 2 deletions chart/templates/workers/worker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
## Airflow Worker Deployment
#################################
{{- $persistence := .Values.workers.persistence.enabled }}
{{- $keda := .Values.workers.keda.enabled }}
{{- if or (eq .Values.executor "CeleryExecutor") (eq .Values.executor "CeleryKubernetesExecutor") }}
{{- $nodeSelector := or .Values.workers.nodeSelector .Values.nodeSelector }}
{{- $affinity := or .Values.workers.affinity .Values.affinity }}
Expand All @@ -44,10 +45,12 @@ metadata:
{{- toYaml .Values.workers.annotations | nindent 4 }}
{{- end }}
spec:
{{- if $persistence }}
{{- if $persistence }}
serviceName: {{ .Release.Name }}-worker
{{- end }}
{{- end }}
{{- if not $keda }}
replicas: {{ .Values.workers.replicas }}
{{- end }}
{{- if $revisionHistoryLimit }}
revisionHistoryLimit: {{ $revisionHistoryLimit }}
{{- end }}
Expand Down
13 changes: 13 additions & 0 deletions tests/charts/test_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,19 @@ def test_should_add_component_specific_labels(self):
assert "test_label" in jmespath.search("metadata.labels", docs[0])
assert jmespath.search("metadata.labels", docs[0])["test_label"] == "test_label_value"

def test_should_remove_replicas_field(self):
docs = render_chart(
values={
"executor": "CeleryExecutor",
"workers": {
"keda": {"enabled": True},
},
},
show_only=["templates/workers/worker-deployment.yaml"],
)

assert "replicas" not in jmespath.search("spec", docs[0])


class TestWorkerNetworkPolicy:
def test_should_add_component_specific_labels(self):
Expand Down