mirror of
https://github.com/docker/compose.git
synced 2025-07-27 07:34:10 +02:00
Fix scaling when some containers are not running
Signed-off-by: aiordache <anca.iordache@docker.com>
This commit is contained in:
parent
ddec1f61a6
commit
50a4afaf17
@ -411,7 +411,7 @@ class Service:
|
|||||||
stopped = [c for c in containers if not c.is_running]
|
stopped = [c for c in containers if not c.is_running]
|
||||||
|
|
||||||
if stopped:
|
if stopped:
|
||||||
return ConvergencePlan('start', stopped)
|
return ConvergencePlan('start', containers)
|
||||||
|
|
||||||
return ConvergencePlan('noop', containers)
|
return ConvergencePlan('noop', containers)
|
||||||
|
|
||||||
@ -514,8 +514,9 @@ class Service:
|
|||||||
self._downscale(containers[scale:], timeout)
|
self._downscale(containers[scale:], timeout)
|
||||||
containers = containers[:scale]
|
containers = containers[:scale]
|
||||||
if start:
|
if start:
|
||||||
|
stopped = [c for c in containers if not c.is_running]
|
||||||
_, errors = parallel_execute(
|
_, errors = parallel_execute(
|
||||||
containers,
|
stopped,
|
||||||
lambda c: self.start_container_if_stopped(c, attach_logs=not detached, quiet=True),
|
lambda c: self.start_container_if_stopped(c, attach_logs=not detached, quiet=True),
|
||||||
lambda c: c.name,
|
lambda c: c.name,
|
||||||
"Starting",
|
"Starting",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user