dstandish commented on code in PR #40568:
URL: https://github.com/apache/airflow/pull/40568#discussion_r1664552275


##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -614,15 +622,18 @@ def await_pod_completion(
         :param container_name: name of the container within the pod
         :return: tuple[State, str | None]
         """
-        while True:
-            remote_pod = self.read_pod(pod)
-            if remote_pod.status.phase in PodPhase.terminal_states:
-                break
-            if istio_enabled and container_is_completed(remote_pod, 
container_name):
-                break
-            self.log.info("Pod %s has phase %s", pod.metadata.name, 
remote_pod.status.phase)
-            time.sleep(2)
-        return remote_pod
+        remote_pod = 
self._client.read_namespaced_pod_status(pod.metadata.name, 
pod.metadata.namespace)
+        self.log.info("Pod %s has phase %s", pod.metadata.name, 
remote_pod.status.phase)
+
+        if any(
+            [
+                remote_pod.status.phase in PodPhase.terminal_states,
+                istio_enabled and container_is_completed(remote_pod, 
container_name),
+            ]

Review Comment:
   crap i was thinking it would be generator not tuple :) 



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