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



##########
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:
       I wonder if we should make this actually dump the whole pod like it 
would if `is_delete_operator_pod` was false, instead of the state. It would 
take a little refactoring to make it happen, but seems like it could be pretty 
helpful in that scenario?
   
   Maybe this exception should always just include the state, then have 
`create_new_pod_for_operator` log the full pod on failure?




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