hussein-awala commented on code in PR #31389:
URL: https://github.com/apache/airflow/pull/31389#discussion_r1284727589
##########
airflow/providers/cncf/kubernetes/utils/pod_manager.py:
##########
@@ -153,6 +153,31 @@ def container_is_terminated(pod: V1Pod, container_name:
str) -> bool:
return container_status.state.terminated is not None
+def container_is_completed(pod: V1Pod, container_name: str) -> bool:
+ """
+ Examines V1Pod ``pod`` to determine whether ``container_name`` is
completed.
+ If that container is present and completed, returns True. Returns False
otherwise.
+ """
+ container_status = get_container_status(pod, container_name)
+ if not container_status:
+ return False
+ return container_status.state.terminated is not None
+
+
+def container_is_succeeded(pod: V1Pod, container_name: str) -> bool:
+ """
+ Examines V1Pod ``pod`` to determine whether ``container_name`` is
completed and succeeded.
+ If that container is present and completed and succeeded, returns True.
Returns False otherwise.
+ """
+ if not container_is_completed(pod, container_name):
+ return False
+
+ container_status = get_container_status(pod, container_name)
+ if not container_status:
+ return False
+ return container_status.state.terminated.exit_code == 0
+
+
Review Comment:
I think there is a problem with the rebase/merge, because these methods
exist already in main branch
##########
airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -238,6 +238,7 @@ class KubernetesPodOperator(BaseOperator):
state, or the execution is interrupted. If True (default), delete the
pod; if False, leave the pod.
Deprecated - use `on_finish_action` instead.
+ :param istio_enabled: Whether istio is enabled in k8s cluster. False by
default.
Review Comment:
I wonder if we can avoid adding a new argument, by adding a new option in
`OnFinishAction`, wdyt?
--
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]