paramjeet01 commented on code in PR #39702:
URL: https://github.com/apache/airflow/pull/39702#discussion_r1605983417
##########
airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -597,13 +598,14 @@ def execute_sync(self, context: Context):
ti.xcom_push(key="pod_name", value=self.pod.metadata.name)
ti.xcom_push(key="pod_namespace",
value=self.pod.metadata.namespace)
- # get remote pod for use in cleanup methods
- self.remote_pod = self.find_pod(self.pod.metadata.namespace,
context=context)
if self.callbacks:
self.callbacks.on_pod_creation(
pod=self.remote_pod, client=self.client,
mode=ExecutionMode.SYNC
)
self.await_pod_start(pod=self.pod)
+
+ # get remote pod for use in cleanup methods
+ self.remote_pod = self.find_pod(self.pod.metadata.namespace,
context=context)
Review Comment:
Moved `remote_pod` after `await_pod_start` , so that the `find_pod` method
will properly choose the running pods as pending pods won't be picked up by
`find_pod` method. Pardon , I just now saw that we implemented callbacks, I'll
move the block below.
--
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]