mirror of
https://github.com/containers/podman-compose.git
synced 2024-11-26 01:43:49 +01:00
FIXES #462: fix extends merge
This commit is contained in:
parent
ebb3dfe634
commit
d05cad4c65
@ -1150,6 +1150,8 @@ def normalize(compose):
|
|||||||
normalize_service(service)
|
normalize_service(service)
|
||||||
return compose
|
return compose
|
||||||
|
|
||||||
|
def clone(value):
|
||||||
|
return value.copy() if is_list(value) or is_dict(value) else value
|
||||||
|
|
||||||
def rec_merge_one(target, source):
|
def rec_merge_one(target, source):
|
||||||
"""
|
"""
|
||||||
@ -1159,7 +1161,7 @@ def rec_merge_one(target, source):
|
|||||||
for key, value in source.items():
|
for key, value in source.items():
|
||||||
if key in target:
|
if key in target:
|
||||||
continue
|
continue
|
||||||
target[key] = value
|
target[key] = clone(value)
|
||||||
done.add(key)
|
done.add(key)
|
||||||
for key, value in target.items():
|
for key, value in target.items():
|
||||||
if key in done:
|
if key in done:
|
||||||
@ -1168,7 +1170,7 @@ def rec_merge_one(target, source):
|
|||||||
continue
|
continue
|
||||||
value2 = source[key]
|
value2 = source[key]
|
||||||
if key == "command":
|
if key == "command":
|
||||||
target[key] = value2
|
target[key] = clone(value2)
|
||||||
continue
|
continue
|
||||||
if not isinstance(value2, type(value)):
|
if not isinstance(value2, type(value)):
|
||||||
value_type = type(value)
|
value_type = type(value)
|
||||||
|
Loading…
Reference in New Issue
Block a user