diff --git a/chart/files/pod-template-file.kubernetes-helm-yaml b/chart/files/pod-template-file.kubernetes-helm-yaml index 097a05ad39653..679b1ba451559 100644 --- a/chart/files/pod-template-file.kubernetes-helm-yaml +++ b/chart/files/pod-template-file.kubernetes-helm-yaml @@ -80,6 +80,9 @@ spec: {{- if .Values.workers.extraContainers }} {{- toYaml .Values.workers.extraContainers | nindent 4 }} {{- end }} + {{- if .Values.workers.priorityClassName }} + priorityClassName: {{ .Values.workers.priorityClassName }} + {{- end }} {{- if or .Values.registry.secretName .Values.registry.connection }} imagePullSecrets: - name: {{ template "registry_secret" . }} diff --git a/tests/charts/airflow_aux/test_pod_template_file.py b/tests/charts/airflow_aux/test_pod_template_file.py index 6ec7c35aabca0..201d857a4163d 100644 --- a/tests/charts/airflow_aux/test_pod_template_file.py +++ b/tests/charts/airflow_aux/test_pod_template_file.py @@ -733,3 +733,16 @@ def test_workers_host_aliases(self): assert "127.0.0.2" == jmespath.search("spec.hostAliases[0].ip", docs[0]) assert "test.hostname" == jmespath.search("spec.hostAliases[0].hostnames[0]", docs[0]) + + def test_workers_priority_class_name(self): + docs = render_chart( + values={ + "workers": { + "priorityClassName": "test-priority", + }, + }, + show_only=["templates/pod-template-file.yaml"], + chart_dir=self.temp_chart_dir, + ) + + assert "test-priority" == jmespath.search("spec.priorityClassName", docs[0])