mirror of https://github.com/docker/compose.git
Ignore attachable property on networks in compatibility mode
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
1cf1217ecb
commit
f368b4846f
|
@ -918,6 +918,11 @@ def convert_restart_policy(name):
|
|||
|
||||
|
||||
def translate_deploy_keys_to_container_config(service_dict):
|
||||
if 'credential_spec' in service_dict:
|
||||
del service_dict['credential_spec']
|
||||
if 'configs' in service_dict:
|
||||
del service_dict['configs']
|
||||
|
||||
if 'deploy' not in service_dict:
|
||||
return service_dict, []
|
||||
|
||||
|
@ -946,10 +951,6 @@ def translate_deploy_keys_to_container_config(service_dict):
|
|||
)
|
||||
|
||||
del service_dict['deploy']
|
||||
if 'credential_spec' in service_dict:
|
||||
del service_dict['credential_spec']
|
||||
if 'configs' in service_dict:
|
||||
del service_dict['configs']
|
||||
|
||||
return service_dict, ignored_keys
|
||||
|
||||
|
|
|
@ -80,6 +80,10 @@ def denormalize_config(config, image_digests=None):
|
|||
elif 'external' in conf:
|
||||
conf['external'] = True
|
||||
|
||||
if 'attachable' in conf and config.version < V3_2:
|
||||
# For compatibility mode, this option is invalid in v2
|
||||
del conf['attachable']
|
||||
|
||||
return result
|
||||
|
||||
|
||||
|
|
|
@ -481,6 +481,7 @@ class CLITestCase(DockerClientTestCase):
|
|||
assert yaml.load(result.stdout) == {
|
||||
'version': '2.3',
|
||||
'volumes': {'foo': {'driver': 'default'}},
|
||||
'networks': {'bar': {}},
|
||||
'services': {
|
||||
'foo': {
|
||||
'command': '/bin/true',
|
||||
|
@ -490,9 +491,10 @@ class CLITestCase(DockerClientTestCase):
|
|||
'mem_limit': '300M',
|
||||
'mem_reservation': '100M',
|
||||
'cpus': 0.7,
|
||||
'volumes': ['foo:/bar:rw']
|
||||
'volumes': ['foo:/bar:rw'],
|
||||
'networks': {'bar': None},
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
def test_ps(self):
|
||||
|
|
|
@ -16,7 +16,13 @@ services:
|
|||
memory: 100M
|
||||
volumes:
|
||||
- foo:/bar
|
||||
networks:
|
||||
- bar
|
||||
|
||||
volumes:
|
||||
foo:
|
||||
driver: default
|
||||
|
||||
networks:
|
||||
bar:
|
||||
attachable: true
|
||||
|
|
Loading…
Reference in New Issue