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 ad450308a2 Chart: pass workers.terminationGracePeriodSeconds into
KubeExecutor pod template (#33514)
ad450308a2 is described below
commit ad450308a2cc07d90e12a4765108c7767257ff2e
Author: Sam Wheating <[email protected]>
AuthorDate: Fri Aug 18 20:48:14 2023 -0700
Chart: pass workers.terminationGracePeriodSeconds into KubeExecutor pod
template (#33514)
---
chart/files/pod-template-file.kubernetes-helm-yaml | 1 +
helm_tests/airflow_aux/test_pod_template_file.py | 13 +++++++++++++
2 files changed, 14 insertions(+)
diff --git a/chart/files/pod-template-file.kubernetes-helm-yaml
b/chart/files/pod-template-file.kubernetes-helm-yaml
index d0d004c902..5be3f8a404 100644
--- a/chart/files/pod-template-file.kubernetes-helm-yaml
+++ b/chart/files/pod-template-file.kubernetes-helm-yaml
@@ -103,6 +103,7 @@ spec:
securityContext: {{ $securityContext | nindent 4 }}
nodeSelector: {{- toYaml $nodeSelector | nindent 4 }}
affinity: {{- toYaml $affinity | nindent 4 }}
+ terminationGracePeriodSeconds: {{
.Values.workers.terminationGracePeriodSeconds }}
tolerations: {{- toYaml $tolerations | nindent 4 }}
topologySpreadConstraints: {{- toYaml $topologySpreadConstraints | nindent 4
}}
serviceAccountName: {{ include "worker.serviceAccountName" . }}
diff --git a/helm_tests/airflow_aux/test_pod_template_file.py
b/helm_tests/airflow_aux/test_pod_template_file.py
index 752670f643..46780c1e34 100644
--- a/helm_tests/airflow_aux/test_pod_template_file.py
+++ b/helm_tests/airflow_aux/test_pod_template_file.py
@@ -767,3 +767,16 @@ class TestPodTemplateFile:
assert lifecycle_hook_params["lifecycle_parsed"] == jmespath.search(
f"spec.containers[0].lifecycle.{hook_type}", docs[0]
)
+
+ def test_termination_grace_period_seconds(self):
+ docs = render_chart(
+ values={
+ "workers": {
+ "terminationGracePeriodSeconds": 123,
+ },
+ },
+ show_only=["templates/pod-template-file.yaml"],
+ chart_dir=self.temp_chart_dir,
+ )
+
+ assert 123 == jmespath.search("spec.terminationGracePeriodSeconds",
docs[0])