mirror of
https://github.com/docker/compose.git
synced 2025-07-28 16:14:06 +02:00
Merge pull request #5565 from docker/5310-revert-5435
Revert -d/--timeout exclusion
This commit is contained in:
commit
9aa9758819
@ -926,30 +926,29 @@ class TopLevelCommand(object):
|
|||||||
Options:
|
Options:
|
||||||
-d Detached mode: Run containers in the background,
|
-d Detached mode: Run containers in the background,
|
||||||
print new container names. Incompatible with
|
print new container names. Incompatible with
|
||||||
--abort-on-container-exit and --timeout.
|
--abort-on-container-exit.
|
||||||
--no-color Produce monochrome output.
|
--no-color Produce monochrome output.
|
||||||
--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 dependent 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
|
||||||
Incompatible with --force-recreate.
|
them. Incompatible with --force-recreate.
|
||||||
--no-build Don't build an image, even if it's missing.
|
--no-build Don't build an image, even if it's missing.
|
||||||
--no-start Don't start the services after creating them.
|
--no-start Don't start the services after creating them.
|
||||||
--build Build images before starting containers.
|
--build Build images before starting containers.
|
||||||
--abort-on-container-exit Stops all containers if any container was stopped.
|
--abort-on-container-exit Stops all containers if any container was
|
||||||
Incompatible with -d.
|
stopped. Incompatible with -d.
|
||||||
-t, --timeout TIMEOUT Use this timeout in seconds for container shutdown
|
-t, --timeout TIMEOUT Use this timeout in seconds for container
|
||||||
when attached or when containers are already.
|
shutdown when attached or when containers are
|
||||||
Incompatible with -d.
|
already running. (default: 10)
|
||||||
running. (default: 10)
|
|
||||||
--remove-orphans Remove containers for services not
|
--remove-orphans Remove containers for services not
|
||||||
defined in the Compose file
|
defined in the Compose file
|
||||||
--exit-code-from SERVICE Return the exit code of the selected service container.
|
--exit-code-from SERVICE Return the exit code of the selected service
|
||||||
Implies --abort-on-container-exit.
|
container. Implies --abort-on-container-exit.
|
||||||
--scale SERVICE=NUM Scale SERVICE to NUM instances. Overrides the `scale`
|
--scale SERVICE=NUM Scale SERVICE to NUM instances. Overrides the
|
||||||
setting in the Compose file if present.
|
`scale` setting in the Compose file if present.
|
||||||
"""
|
"""
|
||||||
start_deps = not options['--no-deps']
|
start_deps = not options['--no-deps']
|
||||||
always_recreate_deps = options['--always-recreate-deps']
|
always_recreate_deps = options['--always-recreate-deps']
|
||||||
@ -964,9 +963,6 @@ class TopLevelCommand(object):
|
|||||||
if detached and (cascade_stop or exit_value_from):
|
if detached and (cascade_stop or exit_value_from):
|
||||||
raise UserError("--abort-on-container-exit and -d cannot be combined.")
|
raise UserError("--abort-on-container-exit and -d cannot be combined.")
|
||||||
|
|
||||||
if detached and timeout:
|
|
||||||
raise UserError("-d and --timeout cannot be combined.")
|
|
||||||
|
|
||||||
environment = Environment.from_env_file(self.project_dir)
|
environment = Environment.from_env_file(self.project_dir)
|
||||||
ignore_orphans = environment.get_boolean('COMPOSE_IGNORE_ORPHANS')
|
ignore_orphans = environment.get_boolean('COMPOSE_IGNORE_ORPHANS')
|
||||||
|
|
||||||
|
@ -1361,9 +1361,12 @@ class CLITestCase(DockerClientTestCase):
|
|||||||
['up', '-d', '--force-recreate', '--no-recreate'],
|
['up', '-d', '--force-recreate', '--no-recreate'],
|
||||||
returncode=1)
|
returncode=1)
|
||||||
|
|
||||||
def test_up_with_timeout_detached(self):
|
def test_up_with_timeout(self):
|
||||||
result = self.dispatch(['up', '-d', '-t', '1'], returncode=1)
|
self.dispatch(['up', '-d', '-t', '1'])
|
||||||
assert "-d and --timeout cannot be combined." in result.stderr
|
service = self.project.get_service('simple')
|
||||||
|
another = self.project.get_service('another')
|
||||||
|
assert len(service.containers()) == 1
|
||||||
|
assert len(another.containers()) == 1
|
||||||
|
|
||||||
@mock.patch.dict(os.environ)
|
@mock.patch.dict(os.environ)
|
||||||
def test_up_with_ignore_remove_orphans(self):
|
def test_up_with_ignore_remove_orphans(self):
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user