MatthewRBruce commented on a change in pull request #15490:
URL: https://github.com/apache/airflow/pull/15490#discussion_r625293615



##########
File path: airflow/providers/cncf/kubernetes/operators/kubernetes_pod.py
##########
@@ -365,7 +365,10 @@ def execute(self, context) -> Optional[str]:
                 self.log.info("creating pod with labels %s and launcher %s", 
labels, launcher)
                 final_state, _, result = 
self.create_new_pod_for_operator(labels, launcher)
             if final_state != State.SUCCESS:
-                status = 
self.client.read_namespaced_pod(self.pod.metadata.name, self.namespace)
+                if self.is_delete_operator_pod:
+                    status = final_state

Review comment:
       Okay, I've updated the code to return the full V1Pod back through from 
`monitor_pod`.  This allows Airflow to log the full pod description in the 
event of a failure regardless of `is_delete_pod_operator`. 
   
   I modified the original test that checked whether `read_namespaced_pod` was 
called in the event of a failure, since it doesn't need to be called either way 
now - it just checks that the failed pod description is reported in the 
Exception.




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

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


Reply via email to