mirror of
https://github.com/containers/podman-compose.git
synced 2025-04-23 17:09:23 +02:00
use set to add them once
This commit is contained in:
parent
1ad8c19e85
commit
ed09b46f83
@ -87,13 +87,13 @@ def move_list(dst, containers, key):
|
|||||||
"""
|
"""
|
||||||
move key (like port forwarding) from containers to dst (a pod or a infra container)
|
move key (like port forwarding) from containers to dst (a pod or a infra container)
|
||||||
"""
|
"""
|
||||||
a=dst.get(key) or []
|
a=set(dst.get(key) or [])
|
||||||
for cnt in containers:
|
for cnt in containers:
|
||||||
a0 = cnt.get(key)
|
a0 = cnt.get(key)
|
||||||
if a0:
|
if a0:
|
||||||
a.extend(a0)
|
a.update(a0)
|
||||||
del cnt[key]
|
del cnt[key]
|
||||||
if a: dst[key]=a
|
if a: dst[key]=list(a)
|
||||||
|
|
||||||
def move_port_fw(dst, containers):
|
def move_port_fw(dst, containers):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user