sealmove commented on code in PR #56043:
URL: https://github.com/apache/airflow/pull/56043#discussion_r2382655814


##########
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:
   Actually this popped up at my work. We are using Airflow to spawn containers 
in a 2-node Swarm Cluster (the plan is to add more nodes eventually).
   Currently until this is merged, I am shadowing docker_swarm.py using volume 
in docker compose.
   So it's tested in a real world system, specifically with docker version 
28.4.0.



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