paolo-moriello commented on code in PR #39789:
URL: https://github.com/apache/airflow/pull/39789#discussion_r1612847856
##########
airflow/providers/cncf/kubernetes/operators/pod.py:
##########
@@ -611,16 +611,7 @@ def execute_sync(self, context: Context):
mode=ExecutionMode.SYNC,
)
- if self.get_logs:
- self.pod_manager.fetch_requested_container_logs(
- pod=self.pod,
- containers=self.container_logs,
- follow_logs=True,
- )
- if not self.get_logs or (
- self.container_logs is not True and self.base_container_name
not in self.container_logs
- ):
- self.await_container_completion(pod=self.pod,
container_name=self.base_container_name)
+ self.await_container_completion(pod=self.pod)
Review Comment:
> We were calling a function based on flag, avoid a call if not set.
The `await_container_completion` was a one-liner, that I created in my
previous PR. I've now just moved this entire if-else logic inside the function
itself; to avoid changing the signature we'd have to instead duplicate the
tenacy-retry logic. Since this function is used only in this place, it is safe
to make the change. wdyt? I'm of course also happy to create a separate
function if you disagree :)
--
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]