mirror of
https://github.com/containers/podman-compose.git
synced 2024-11-23 00:13:25 +01:00
add ipam-driver support
Signed-off-by: Benedikt Braunger <bb@emlix.com>
This commit is contained in:
parent
016c97fd1e
commit
8625d7a4e8
@ -746,7 +746,7 @@ def assert_cnt_nets(compose, cnt):
|
||||
"--label",
|
||||
f"com.docker.compose.project={proj_name}",
|
||||
]
|
||||
# TODO: add more options here, like driver, internal, ..etc
|
||||
# TODO: add more options here, like dns, ipv6, etc.
|
||||
labels = net_desc.get("labels", None) or []
|
||||
for item in norm_as_list(labels):
|
||||
args.extend(["--label", item])
|
||||
@ -758,15 +758,17 @@ def assert_cnt_nets(compose, cnt):
|
||||
driver_opts = net_desc.get("driver_opts", None) or {}
|
||||
for key, value in driver_opts.items():
|
||||
args.extend(("--opt", f"{key}={value}"))
|
||||
ipam_config_ls = (net_desc.get("ipam", None) or {}).get(
|
||||
"config", None
|
||||
) or []
|
||||
ipam = (net_desc.get("ipam", None) or {})
|
||||
ipam_driver = ipam.get("driver", None)
|
||||
if ipam_driver:
|
||||
args.extend(("--ipam-driver", ipam_driver))
|
||||
ipam_config_ls = ipam.get("config", None) or []
|
||||
if is_dict(ipam_config_ls):
|
||||
ipam_config_ls = [ipam_config_ls]
|
||||
for ipam in ipam_config_ls:
|
||||
subnet = ipam.get("subnet", None)
|
||||
ip_range = ipam.get("ip_range", None)
|
||||
gateway = ipam.get("gateway", None)
|
||||
for ipam_config in ipam_config_ls:
|
||||
subnet = ipam_config.get("subnet", None)
|
||||
ip_range = ipam_config.get("ip_range", None)
|
||||
gateway = ipam_config.get("gateway", None)
|
||||
if subnet:
|
||||
args.extend(("--subnet", subnet))
|
||||
if ip_range:
|
||||
|
Loading…
Reference in New Issue
Block a user