mirror of
https://github.com/docker/compose.git
synced 2025-07-22 13:14:29 +02:00
Merge pull request #5472 from docker/5462-stop_grace_period
Add stop_grace_period to ALLOWED_KEYS
This commit is contained in:
commit
e8d4616723
@ -367,10 +367,10 @@ class TopLevelCommand(object):
|
|||||||
Options:
|
Options:
|
||||||
--rmi type Remove images. Type must be one of:
|
--rmi type Remove images. Type must be one of:
|
||||||
'all': Remove all images used by any service.
|
'all': Remove all images used by any service.
|
||||||
'local': Remove only images that don't have a custom tag
|
'local': Remove only images that don't have a
|
||||||
set by the `image` field.
|
custom tag set by the `image` field.
|
||||||
-v, --volumes Remove named volumes declared in the `volumes` section
|
-v, --volumes Remove named volumes declared in the `volumes`
|
||||||
of the Compose file and anonymous volumes
|
section of the Compose file and anonymous volumes
|
||||||
attached to containers.
|
attached to containers.
|
||||||
--remove-orphans Remove containers for services not defined in the
|
--remove-orphans Remove containers for services not defined in the
|
||||||
Compose file
|
Compose file
|
||||||
|
@ -126,6 +126,7 @@ ALLOWED_KEYS = DOCKER_CONFIG_KEYS + [
|
|||||||
'network_mode',
|
'network_mode',
|
||||||
'init',
|
'init',
|
||||||
'scale',
|
'scale',
|
||||||
|
'stop_grace_period',
|
||||||
]
|
]
|
||||||
|
|
||||||
DOCKER_VALID_URL_PREFIXES = (
|
DOCKER_VALID_URL_PREFIXES = (
|
||||||
|
@ -1150,7 +1150,8 @@ class ConfigTest(unittest.TestCase):
|
|||||||
'volumes': [
|
'volumes': [
|
||||||
{'source': '/a', 'target': '/b', 'type': 'bind'},
|
{'source': '/a', 'target': '/b', 'type': 'bind'},
|
||||||
{'source': 'vol', 'target': '/x', 'type': 'volume', 'read_only': True}
|
{'source': 'vol', 'target': '/x', 'type': 'volume', 'read_only': True}
|
||||||
]
|
],
|
||||||
|
'stop_grace_period': '30s',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'volumes': {'vol': {}}
|
'volumes': {'vol': {}}
|
||||||
@ -1177,6 +1178,7 @@ class ConfigTest(unittest.TestCase):
|
|||||||
'/c:/b:rw',
|
'/c:/b:rw',
|
||||||
{'source': 'vol', 'target': '/x', 'type': 'volume', 'read_only': True}
|
{'source': 'vol', 'target': '/x', 'type': 'volume', 'read_only': True}
|
||||||
]
|
]
|
||||||
|
assert service_dicts[0]['stop_grace_period'] == '30s'
|
||||||
|
|
||||||
@mock.patch.dict(os.environ)
|
@mock.patch.dict(os.environ)
|
||||||
def test_volume_mode_override(self):
|
def test_volume_mode_override(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user