NilsIrl commented on code in PR #40814:
URL: https://github.com/apache/airflow/pull/40814#discussion_r1828343415


##########
airflow/providers/cncf/kubernetes/operators/job.py:
##########
@@ -159,34 +166,59 @@ def execute(self, context: Context):
         ti.xcom_push(key="job_name", value=self.job.metadata.name)
         ti.xcom_push(key="job_namespace", value=self.job.metadata.namespace)
 
+        if self.pod is None:
+            self.pod = self.get_or_create_pod(  # must set `self.pod` for 
`on_kill`
+                pod_request_obj=self.pod_request_obj,
+                context=context,
+            )

Review Comment:
   How does this work if the pod wasn't already created by the time this is 
reached? Won't 2 pods eventually get created?



##########
airflow/providers/cncf/kubernetes/operators/job.py:
##########
@@ -159,34 +166,59 @@ def execute(self, context: Context):
         ti.xcom_push(key="job_name", value=self.job.metadata.name)
         ti.xcom_push(key="job_namespace", value=self.job.metadata.namespace)
 
+        if self.pod is None:
+            self.pod = self.get_or_create_pod(  # must set `self.pod` for 
`on_kill`
+                pod_request_obj=self.pod_request_obj,
+                context=context,
+            )

Review Comment:
   How does this work if the pod wasn't already created by the time this is 
reached? Won't 2 pods eventually get created (when the job eventually creates 
the pod)?



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