Provide valid serialization of depends_on when format is not 2.1
Signed-off-by: Joffrey F <joffrey@docker.com>
This commit is contained in:
parent
ab97716a95
commit
76678747c7
2 changed files with 39 additions and 1 deletions
|
|
@ -56,9 +56,16 @@ def denormalize_service_dict(service_dict, version):
|
|||
service_dict = service_dict.copy()
|
||||
|
||||
if 'restart' in service_dict:
|
||||
service_dict['restart'] = types.serialize_restart_spec(service_dict['restart'])
|
||||
service_dict['restart'] = types.serialize_restart_spec(
|
||||
service_dict['restart']
|
||||
)
|
||||
|
||||
if version == V1 and 'network_mode' not in service_dict:
|
||||
service_dict['network_mode'] = 'bridge'
|
||||
|
||||
if 'depends_on' in service_dict and version != V2_1:
|
||||
service_dict['depends_on'] = sorted([
|
||||
svc for svc in service_dict['depends_on'].keys()
|
||||
])
|
||||
|
||||
return service_dict
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue