jason810496 commented on code in PR #56043:
URL: https://github.com/apache/airflow/pull/56043#discussion_r2382312047
##########
providers/docker/src/airflow/providers/docker/operators/docker_swarm.py:
##########
@@ -218,9 +218,8 @@ def _run_service(self) -> None:
if self.service and self._service_status() == "complete":
self.tasks = self.cli.tasks(filters={"service":
self.service["ID"]})
for task in self.tasks:
- container_id = task["Status"]["ContainerStatus"]["ContainerID"]
- container = self.cli.inspect_container(container_id)
- self.containers.append(container)
+ docker_service = self.cli.inspect_service(task["ServiceID"])
+ self.containers.append(docker_service)
Review Comment:
> What kind of combatibility are we trying to achieve?
I'm not sure will the change introduce breaking change for Docker Swarm side
(e.g. not compatible for lower Docker Swarm Version )
> I would say that inspect_container() is wrong in general because it works
only in 1-node deployments. I don't see why/when ServiceID is not available,
since we are working with services specifically, which is the fundamental
resource of Docker Swarm.
Thanks for the clarification! If this is the case, then the change LGTM.
Additionally, it would be nice to test this change with real Airflow setup,
then this PR is ready to go. Thanks!
--
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]