jedcunningham commented on a change in pull request #21905:
URL: https://github.com/apache/airflow/pull/21905#discussion_r817038009



##########
File path: airflow/kubernetes/pod_generator_deprecated.py
##########
@@ -178,7 +178,7 @@ def __init__(
 
         self.container.command = cmds or []
         self.container.args = args or []
-        self.container.image_pull_policy = image_pull_policy
+        self.container.image_pull_policy = image_pull_policy if 
image_pull_policy else "IfNotPresent"

Review comment:
       I'm... confused... then. This works locally for me with 23.3.0
   
   ```
   --- a/airflow/kubernetes/pod_generator_deprecated.py
   +++ b/airflow/kubernetes/pod_generator_deprecated.py
   @@ -178,7 +178,8 @@ class PodGenerator:
    
            self.container.command = cmds or []
            self.container.args = args or []
   -        self.container.image_pull_policy = image_pull_policy
   +        if 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 []
   @@ -187,7 +188,8 @@ class PodGenerator:
            self.spec = k8s.V1PodSpec(containers=[])
            self.spec.security_context = security_context
            self.spec.tolerations = tolerations
   -        self.spec.dns_policy = dnspolicy
   +        if dnspolicy:
   +            self.spec.dns_policy = dnspolicy
            self.spec.scheduler_name = schedulername
            self.spec.host_network = hostnetwork
            self.spec.affinity = affinity
   @@ -195,7 +197,8 @@ class PodGenerator:
            self.spec.init_containers = init_containers
            self.spec.volumes = volumes or []
            self.spec.node_selector = node_selectors
   -        self.spec.restart_policy = restart_policy
   +        if restart_policy:
   +            self.spec.restart_policy = restart_policy
            self.spec.priority_class_name = priority_class_name
    
            self.spec.image_pull_secrets = []
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to