noamst-monday commented on code in PR #70595:
URL: https://github.com/apache/airflow/pull/70595#discussion_r3666805745


##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/cli/kubernetes_command.py:
##########
@@ -119,6 +119,21 @@ def generate_pod_yaml(args):
     print(f"YAML output can be found at {yaml_output_path}")
 
 
+def _get_pod_completion_time(pod):
+    """
+    Return the time the pod entered a terminal state, or its creation time as 
fallback.
+
+    Uses the latest ``finished_at`` timestamp across all container statuses so 
that pods
+    with multiple containers (e.g. an init container + a base container) are 
judged by
+    the time the *last* container finished, not by when the pod was created.
+    """
+    times = []
+    for status in pod.status.container_statuses or []:

Review Comment:
   Thanks! Appreciate your review, I'll take a look and update.



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