mirror of
https://github.com/docker/compose.git
synced 2025-07-23 21:54:40 +02:00
Reword & Optimize getting stopped containers & update tests
Signed-off-by: Drew Romanyk <drewiswaycool@gmail.com>
This commit is contained in:
parent
ba0b3d421c
commit
5db3cd60d4
@ -918,7 +918,7 @@ class TopLevelCommand(object):
|
|||||||
--no-deps Don't start linked services.
|
--no-deps Don't start linked services.
|
||||||
--force-recreate Recreate containers even if their configuration
|
--force-recreate Recreate containers even if their configuration
|
||||||
and image haven't changed.
|
and image haven't changed.
|
||||||
--always-recreate-deps Recreate dependant containers.
|
--always-recreate-deps Recreate dependent containers.
|
||||||
Incompatible with --no-recreate.
|
Incompatible with --no-recreate.
|
||||||
--no-recreate If containers already exist, don't recreate them.
|
--no-recreate If containers already exist, don't recreate them.
|
||||||
Incompatible with --force-recreate.
|
Incompatible with --force-recreate.
|
||||||
|
@ -520,8 +520,8 @@ class Project(object):
|
|||||||
log.debug('%s has upstream changes (%s)',
|
log.debug('%s has upstream changes (%s)',
|
||||||
service.name,
|
service.name,
|
||||||
", ".join(updated_dependencies))
|
", ".join(updated_dependencies))
|
||||||
containers_stopped = any((not c.is_paused and not c.is_restarting and not c.is_running
|
containers_stopped = len(
|
||||||
for c in service.containers(stopped=True)))
|
service.containers(stopped=True, filters={'status': ['created', 'exited']})) > 0
|
||||||
has_links = any(c.get('HostConfig.Links') for c in service.containers())
|
has_links = any(c.get('HostConfig.Links') for c in service.containers())
|
||||||
if always_recreate_deps or containers_stopped or not has_links:
|
if always_recreate_deps or containers_stopped or not has_links:
|
||||||
plan = service.convergence_plan(ConvergenceStrategy.always)
|
plan = service.convergence_plan(ConvergenceStrategy.always)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user