priyanshujaiz commented on code in PR #74497:
URL: https://github.com/apache/airflow/pull/74497#discussion_r4303393027
##########
providers/cncf/kubernetes/src/airflow/providers/cncf/kubernetes/operators/job.py:
##########
@@ -287,6 +314,15 @@ def execute_deferrable(self):
)
def execute_complete(self, context: Context, event: dict, **kwargs):
+ if event.get("status") == "readmitted":
+ self.log.info("Job preempted but now readmitted. Re-deferring to
restart pod discovery.")
+ self.job = self.hook.get_job_status(job_name=self.name,
namespace=self.namespace)
Review Comment:
Fixed. I now use `event["name"]` and `event["namespace"]` to fetch the job
status, ensuring the actual Kubernetes resource identity is used, including
when `random_name_suffix` is enabled. Added
`test_execute_complete_readmitted_uses_event_job_identity` to cover this case.
--
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]