From 41cb669a03c564d063943226500240fb64a34e80 Mon Sep 17 00:00:00 2001 From: Aakcht Date: Fri, 19 Jun 2026 20:42:12 +0500 Subject: [PATCH] Add global labels to helm chart priorityclasses --- chart/templates/priorityclasses/priority-classes.yaml | 3 +++ chart/tests/helm_tests/airflow_aux/test_basic_helm_chart.py | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/chart/templates/priorityclasses/priority-classes.yaml b/chart/templates/priorityclasses/priority-classes.yaml index 22153f2c520ab..777c536c0f600 100644 --- a/chart/templates/priorityclasses/priority-classes.yaml +++ b/chart/templates/priorityclasses/priority-classes.yaml @@ -32,6 +32,9 @@ metadata: release: {{ $Global.Release.Name }} chart: "{{ $Global.Chart.Name }}-{{ $Global.Chart.Version }}" heritage: {{ $Global.Release.Service }} + {{- with $Global.Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} preemptionPolicy: {{ default "PreemptLowerPriority" $e.preemptionPolicy }} value: {{ $e.value | required "value is required for priority classes" }} description: "This priority class will not cause other pods to be preempted." diff --git a/chart/tests/helm_tests/airflow_aux/test_basic_helm_chart.py b/chart/tests/helm_tests/airflow_aux/test_basic_helm_chart.py index a89e57d6135e0..ad78b9c970eb4 100644 --- a/chart/tests/helm_tests/airflow_aux/test_basic_helm_chart.py +++ b/chart/tests/helm_tests/airflow_aux/test_basic_helm_chart.py @@ -235,6 +235,9 @@ def test_labels_are_valid(self, executor): "logs": {"persistence": {"enabled": True}}, "dags": {"persistence": {"enabled": True}}, "postgresql": {"enabled": False}, # We won't check the objects created by the postgres chart + "priorityClasses": [ + {"name": "class1", "value": 10000}, + ], } k8s_objects = render_chart(name=release_name, values=values) @@ -303,6 +306,7 @@ def test_labels_are_valid(self, executor): (f"{release_name}-airflow-api-server", "ServiceAccount", "api-server"), (f"{release_name}-api-secret-key", "Secret", "api-server"), (f"{release_name}-api-server-policy", "NetworkPolicy", "airflow-api-server-policy"), + (f"{release_name}-class1", "PriorityClass", None), ] cleanup_kubernetes_executor_only_objects = {