Ankitraj-builds commented on code in PR #76328:
URL: https://github.com/apache/airflow/pull/76328#discussion_r4456807625
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/job.py:
##########
@@ -338,16 +338,20 @@ def execute_complete(self, context: Context, event: dict,
**kwargs):
try:
ti = context["ti"]
ti.xcom_push(key="job", value=event["job"])
- if event["status"] == "error":
- raise AirflowException(event["message"])
if self.get_logs:
for pod_name in event.get("pod_names") or []:
Review Comment:
Good point @henry3260 , done. execute_complete now also lists the Job’s pods
by the batch.kubernetes.io/job-name label, so pods created for backoffLimit
retries after deferral are logged too. If listing fails, it only logs a
warning. Added test_execute_complete_writes_logs_of_pods_created_after_deferral
for this.
I kept cleanup as it was, so it still only covers the pods found before
deferral. Retry pods are owned by the Job, so they are removed with it. Happy
to change that too if you think it belongs here.
--
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]