This is an automated email from the ASF dual-hosted git repository.

jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 0330eec93fb improved the event which is thrown in the event log tab 
when a pod failes for k8s exec (#60800)
0330eec93fb is described below

commit 0330eec93fbc8cf7f1ec18f26e5135a53ad64aa5
Author: Nataneljpwd <[email protected]>
AuthorDate: Sun Jan 25 14:02:30 2026 +0000

    improved the event which is thrown in the event log tab when a pod failes 
for k8s exec (#60800)
    
    Co-authored-by: Natanel Rudyuklakir <[email protected]>
---
 .../providers/cncf/kubernetes/executors/kubernetes_executor.py      | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py
 
b/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py
index fb1b7b54d04..3d7391a46c7 100644
--- 
a/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py
+++ 
b/providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/executors/kubernetes_executor.py
@@ -367,6 +367,8 @@ class KubernetesExecutor(BaseExecutor):
         namespace = results.namespace
         failure_details = results.failure_details
 
+        termination_reason: str | None = None
+
         if state == TaskInstanceState.FAILED:
             # Use pre-collected failure details from the watcher to avoid 
additional API calls
             if failure_details:
@@ -380,6 +382,8 @@ class KubernetesExecutor(BaseExecutor):
                 container_type = failure_details.get("container_type")
                 container_name = failure_details.get("container_name")
 
+                termination_reason = f"Pod failed because of {pod_reason}"
+
                 task_key_str = f"{key.dag_id}.{key.task_id}.{key.try_number}"
                 self.log.warning(
                     "Task %s failed in pod %s/%s. Pod phase: %s, reason: %s, 
message: %s, "
@@ -447,7 +451,7 @@ class KubernetesExecutor(BaseExecutor):
                 state = None
             state = TaskInstanceState(state) if state else None
 
-        self.event_buffer[key] = state, None
+        self.event_buffer[key] = state, termination_reason
 
     @staticmethod
     def _get_pod_namespace(ti: TaskInstance):

Reply via email to