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
2 changes: 1 addition & 1 deletion chart/templates/scheduler/scheduler-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
################################
## Airflow Scheduler Service
#################################
{{- if eq .Values.executor "LocalExecutor" }}
{{- if or (eq .Values.executor "LocalExecutor") (eq .Values.executor "LocalKubernetesExecutor") }}
kind: Service
apiVersion: v1
metadata:
Expand Down
27 changes: 27 additions & 0 deletions tests/charts/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,33 @@ def test_should_add_component_specific_labels(self):


class TestSchedulerService:
@pytest.mark.parametrize(
"executor, creates_service",
[
("LocalExecutor", True),
("CeleryExecutor", False),
("CeleryKubernetesExecutor", False),
("KubernetesExecutor", False),
("LocalKubernetesExecutor", True),
],
)
def test_should_create_scheduler_service_for_specific_executors(self, executor, creates_service):
docs = render_chart(
values={
"executor": executor,
"scheduler": {
"labels": {"test_label": "test_label_value"},
},
},
show_only=["templates/scheduler/scheduler-service.yaml"],
)
if creates_service:
assert jmespath.search("kind", docs[0]) == "Service"
assert "test_label" in jmespath.search("metadata.labels", docs[0])
assert jmespath.search("metadata.labels", docs[0])["test_label"] == "test_label_value"
else:
assert docs == []

def test_should_add_component_specific_labels(self):
docs = render_chart(
values={
Expand Down