From 1264f159f64504fd13adb52f260768a798459033 Mon Sep 17 00:00:00 2001 From: Sam Wheating Date: Fri, 18 Aug 2023 16:01:35 -0700 Subject: [PATCH 1/2] Chart: pass workers.terminationGracePeriodSeconds into KubeExecutor pod template --- chart/files/pod-template-file.kubernetes-helm-yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/chart/files/pod-template-file.kubernetes-helm-yaml b/chart/files/pod-template-file.kubernetes-helm-yaml index d0d004c90277c..5be3f8a404a1e 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" . }} From a5b0e08763436283e87f13cf5501475589e1a75e Mon Sep 17 00:00:00 2001 From: Sam Wheating Date: Fri, 18 Aug 2023 16:21:43 -0700 Subject: [PATCH 2/2] Added test --- helm_tests/airflow_aux/test_pod_template_file.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/helm_tests/airflow_aux/test_pod_template_file.py b/helm_tests/airflow_aux/test_pod_template_file.py index 752670f6431a3..46780c1e34ea6 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 @@ def test_workers_container_lifecycle_webhooks_are_configurable(self, hook_type=" 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])