XD-DENG commented on a change in pull request #4160: [AIRFLOW-3311] Allow pod 
operator to keep failed pods
URL: https://github.com/apache/incubator-airflow/pull/4160#discussion_r238693290
 
 

 ##########
 File path: airflow/contrib/operators/kubernetes_pod_operator.py
 ##########
 @@ -123,7 +130,10 @@ def execute(self, context):
                 get_logs=self.get_logs)
 
             if self.is_delete_operator_pod:
-                launcher.delete_pod(pod)
+                if final_state != State.SUCCESS and self.keep_failed_pod:
+                    pass
+                else:
+                    launcher.delete_pod(pod)
 
 Review comment:
   Another very very minor one: would
   ```python
   if not self.keep_failed_pod or final_state == State.SUCCESS:
       launcher.delete_pod(pod)
   ```
   be more concise?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to