hussein-awala commented on code in PR #29000:
URL: https://github.com/apache/airflow/pull/29000#discussion_r1128523322


##########
airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -670,6 +675,24 @@ def cleanup(self, pod: k8s.V1Pod, remote_pod: k8s.V1Pod):
 
             error_message = get_container_termination_message(remote_pod, 
self.base_container_name)
             error_message = "\n" + error_message if error_message else ""
+            if self.skip_exit_code is not None:
+                container_statuses = (
+                    remote_pod.status.container_statuses if remote_pod and 
remote_pod.status else None
+                )
+                base_container_status = next(
+                    (x for x in container_statuses if x.name == 
self.base_container_name), None

Review Comment:
   :+1:  I added `or []` for container_statuses, this can fix the problem



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