You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/23 16:34:58 UTC

[GitHub] [airflow] jedcunningham commented on a change in pull request #15490: Fix unsuccessful KubernetesPod final_state call when `is_delete_operator_pod=True`

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:
users@infra.apache.org