Skip to content

Commit

Permalink
FIXES #462: fix extends merge
Browse files Browse the repository at this point in the history
  • Loading branch information
muayyad-alsadi committed Mar 28, 2022
1 parent ebb3dfe commit d05cad4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions podman_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -1150,6 +1150,8 @@ def normalize(compose):
normalize_service(service)
return compose

def clone(value):
return value.copy() if is_list(value) or is_dict(value) else value

def rec_merge_one(target, source):
"""
Expand All @@ -1159,7 +1161,7 @@ def rec_merge_one(target, source):
for key, value in source.items():
if key in target:
continue
target[key] = value
target[key] = clone(value)
done.add(key)
for key, value in target.items():
if key in done:
Expand All @@ -1168,7 +1170,7 @@ def rec_merge_one(target, source):
continue
value2 = source[key]
if key == "command":
target[key] = value2
target[key] = clone(value2)
continue
if not isinstance(value2, type(value)):
value_type = type(value)
Expand Down

0 comments on commit d05cad4

Please sign in to comment.