You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2022/03/28 18:16:01 UTC
[airflow] 04/05: Revert "Fix handling some None parameters in kubernetes 23 libs. (#21905)"
This is an automated email from the ASF dual-hosted git repository.
ephraimanierobi pushed a commit to branch v2-2-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit d11c2e9fab7773dfbab25bda8b20a07e8639ecb2
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Mon Mar 28 17:38:20 2022 +0200
Revert "Fix handling some None parameters in kubernetes 23 libs. (#21905)"
This reverts commit 24c84f0acee622f6bba4b8d73f2e9a6831cd364a.
---
airflow/kubernetes/pod_generator_deprecated.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/airflow/kubernetes/pod_generator_deprecated.py b/airflow/kubernetes/pod_generator_deprecated.py
index bb3c980..c4d83d6 100644
--- a/airflow/kubernetes/pod_generator_deprecated.py
+++ b/airflow/kubernetes/pod_generator_deprecated.py
@@ -206,8 +206,7 @@ class PodGenerator:
self.container.command = cmds or []
self.container.args = args or []
- if image_pull_policy:
- self.container.image_pull_policy = image_pull_policy
+ self.container.image_pull_policy = image_pull_policy
self.container.ports = ports or []
self.container.resources = resources
self.container.volume_mounts = volume_mounts or []
@@ -216,8 +215,7 @@ class PodGenerator:
self.spec = k8s.V1PodSpec(containers=[])
self.spec.security_context = security_context
self.spec.tolerations = tolerations
- if dnspolicy:
- self.spec.dns_policy = dnspolicy
+ self.spec.dns_policy = dnspolicy
self.spec.scheduler_name = schedulername
self.spec.host_network = hostnetwork
self.spec.affinity = affinity
@@ -225,8 +223,7 @@ class PodGenerator:
self.spec.init_containers = init_containers
self.spec.volumes = volumes or []
self.spec.node_selector = node_selectors
- if restart_policy:
- self.spec.restart_policy = restart_policy
+ self.spec.restart_policy = restart_policy
self.spec.priority_class_name = priority_class_name
self.spec.image_pull_secrets = []