浏览代码

Fix scaling when some containers are not running

Signed-off-by: aiordache <[email protected]>
aiordache 5 年之前
父节点
当前提交
50a4afaf17
共有 1 个文件被更改,包括 3 次插入2 次删除
  1. 3 2
      compose/service.py

+ 3 - 2
compose/service.py

@@ -411,7 +411,7 @@ class Service:
         stopped = [c for c in containers if not c.is_running]
 
         if stopped:
-            return ConvergencePlan('start', stopped)
+            return ConvergencePlan('start', containers)
 
         return ConvergencePlan('noop', containers)
 
@@ -514,8 +514,9 @@ class Service:
             self._downscale(containers[scale:], timeout)
             containers = containers[:scale]
         if start:
+            stopped = [c for c in containers if not c.is_running]
             _, errors = parallel_execute(
-                containers,
+                stopped,
                 lambda c: self.start_container_if_stopped(c, attach_logs=not detached, quiet=True),
                 lambda c: c.name,
                 "Starting",