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
1 change: 1 addition & 0 deletions chart/templates/scheduler/scheduler-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ metadata:
release: {{ .Release.Name }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
heritage: {{ .Release.Service }}
executor: {{ .Values.executor }}
{{- with .Values.labels }}
{{ toYaml . | indent 4 }}
{{- end }}
Expand Down
5 changes: 4 additions & 1 deletion tests/charts/test_basic_helm_chart.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ def test_labels_are_valid(self):
}
if component:
expected_labels["component"] = component
assert kind_k8s_obj_labels_tuples.pop((k8s_object_name, kind)) == expected_labels
if k8s_object_name == f"{release_name}-scheduler":
expected_labels['executor'] = 'CeleryExecutor'
actual_labels = kind_k8s_obj_labels_tuples.pop((k8s_object_name, kind))
assert actual_labels == expected_labels

if kind_k8s_obj_labels_tuples:
warnings.warn(f"Unchecked objects: {kind_k8s_obj_labels_tuples.keys()}")
Expand Down
18 changes: 18 additions & 0 deletions tests/charts/test_scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,24 @@ def test_persistence_volume_annotations(self):
)
assert {"foo": "bar"} == jmespath.search("spec.volumeClaimTemplates[0].metadata.annotations", docs[0])

@parameterized.expand(
[
"LocalExecutor",
"LocalKubernetesExecutor",
"CeleryExecutor",
"KubernetesExecutor",
"CeleryKubernetesExecutor",
]
)
def test_scheduler_deployment_has_executor_label(self, executor):
docs = render_chart(
values={"executor": executor},
show_only=["templates/scheduler/scheduler-deployment.yaml"],
)

assert 1 == len(docs)
assert executor == docs[0]['metadata']['labels'].get('executor')


class SchedulerNetworkPolicyTest(unittest.TestCase):
def test_should_add_component_specific_labels(self):
Expand Down