hussein-awala commented on code in PR #35714:
URL: https://github.com/apache/airflow/pull/35714#discussion_r1451020122


##########
airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -550,7 +561,17 @@ def execute_sync(self, context: Context):
 
             # 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)
+            if self.callbacks:
+                self.callbacks.on_pod_starting(
+                    pod=self.find_pod(self.pod.metadata.namespace, 
context=context),
+                    client=self.client,
+                    mode=ExecutionMode.SYNC,
+                )

Review Comment:
   I changed the default value to None and added a check if it's different to 
None in order to avoid calling useless methods like `find_pod` when the user 
doesn't provide a callbacks class.



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