You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/04/13 14:21:19 UTC

[GitHub] [airflow] dimberman commented on a change in pull request #15336: Fail task when containers inside a pod fails

dimberman commented on a change in pull request #15336:
URL: https://github.com/apache/airflow/pull/15336#discussion_r612492878



##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -187,25 +190,35 @@ def process_status(
         self,
         pod_id: str,
         namespace: str,
-        status: str,
+        status: V1PodStatus,
         annotations: Dict[str, str],
         resource_version: str,
         event: Any,
     ) -> None:
         """Process status response"""
-        if status == 'Pending':
-            if event['type'] == 'DELETED':
+        pod_status = status.phase
+        if pod_status == 'Pending':
+            # Check container statuses
+            container_statuses = status.container_statuses
+            init_container_statuses = status.init_container_statuses
+            if container_statuses and self._container_image_pull_err(container_statuses):
+                self.log.info('Event: Failed to start pod %s, a container has an ErrImagePull', pod_id)
+                self.watcher_queue.put((pod_id, namespace, State.FAILED, annotations, resource_version))

Review comment:
       @ephraimbuddy I don't think you can change the pod status from inside of Airflow. 




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org