jedcunningham commented on code in PR #23450:
URL: https://github.com/apache/airflow/pull/23450#discussion_r882354593
##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -259,16 +259,16 @@ def await_container_completion(self, pod: V1Pod,
container_name: str) -> None:
while not self.container_is_running(pod=pod,
container_name=container_name):
time.sleep(1)
- def await_pod_completion(self, pod: V1Pod) -> V1Pod:
+ def await_pod_completion(self, pod: V1Pod, base_container: str) -> V1Pod:
"""
- Monitors a pod and returns the final state
+ Monitors the base container in a pod and returns the final state
:param pod: pod spec that will be monitored
:return: Tuple[State, Optional[str]]
"""
while True:
remote_pod = self.read_pod(pod)
- if remote_pod.status.phase in PodPhase.terminal_states:
+ if not self.container_is_running(pod=remote_pod,
container_name=base_container):
Review Comment:
Probably worth having a separate method for doing it based on container, if
we go that way, so we dont introduce a breaking change here.
--
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]