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



##########
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:
       This is what I get when I do it :( 
   ```
       @image_pull_policy.setter
       def image_pull_policy(self, image_pull_policy):
           """Sets the image_pull_policy of this V1Container.
       
           Image pull policy. One of Always, Never, IfNotPresent. Defaults to 
Always if :latest tag is specified, or IfNotPresent otherwise. Cannot be 
updated. More info: 
https://kubernetes.io/docs/concepts/containers/images#updating-images  Possible 
enum values:  - `\"Always\"` means that kubelet always attempts to pull the 
latest image. Container will fail If the pull fails.  - `\"IfNotPresent\"` 
means that kubelet pulls if the image isn't present on disk. Container will 
fail if the image isn't present and the pull fails.  - `\"Never\"` means that 
kubelet never pulls an image, but only uses a local image. Container will fail 
if the image isn't present  # noqa: E501
       
           :param image_pull_policy: The image_pull_policy of this V1Container. 
 # noqa: E501
           :type: str
           """
           allowed_values = ["Always", "IfNotPresent", "Never"]  # noqa: E501
           if self.local_vars_configuration.client_side_validation and 
image_pull_policy not in allowed_values:  # noqa: E501
               raise ValueError(
                   "Invalid value for `image_pull_policy` ({0}), must be one of 
{1}"  # noqa: E501
   >               .format(image_pull_policy, allowed_values)
               )
   E           ValueError: Invalid value for `image_pull_policy` (None), must 
be one of ['Always', 'IfNotPresent', 'Never']
   ```




-- 
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