This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 2c9ce803d7 Add missing priorityClassName to K8S worker pod template
(#31328)
2c9ce803d7 is described below
commit 2c9ce803d744949674e4ec9ac88f73ad0a361399
Author: Hussein Awala <[email protected]>
AuthorDate: Thu Jun 1 03:27:35 2023 +0300
Add missing priorityClassName to K8S worker pod template (#31328)
---
chart/files/pod-template-file.kubernetes-helm-yaml | 3 +++
tests/charts/airflow_aux/test_pod_template_file.py | 13 +++++++++++++
2 files changed, 16 insertions(+)
diff --git a/chart/files/pod-template-file.kubernetes-helm-yaml
b/chart/files/pod-template-file.kubernetes-helm-yaml
index 097a05ad39..679b1ba451 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 6ec7c35aab..201d857a41 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 @@ class TestPodTemplateFile:
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])