From 474c4f464c2fb21d755f69d00806f2594422c1f5 Mon Sep 17 00:00:00 2001 From: Hussein Awala Date: Tue, 16 May 2023 21:54:59 +0200 Subject: [PATCH 1/2] Add missing priorityClassName to K8S worker pod template --- chart/files/pod-template-file.kubernetes-helm-yaml | 3 +++ 1 file changed, 3 insertions(+) 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" . }} From 4ec5a50a8dc80b7844dde1353dc540401b0436f3 Mon Sep 17 00:00:00 2001 From: Hussein Awala Date: Wed, 17 May 2023 10:04:06 +0200 Subject: [PATCH 2/2] add unit test --- tests/charts/airflow_aux/test_pod_template_file.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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])