mirror of
https://github.com/containers/podman-compose.git
synced 2024-11-25 01:13:28 +01:00
Add support for enable_ipv6
Signed-off-by: Maximilian R <maxi.rostock@outlook.de>
This commit is contained in:
parent
bba1f33d51
commit
969edb88d0
@ -705,6 +705,9 @@ def get_network_create_args(net_desc, proj_name, net_name):
|
||||
if ipam_driver:
|
||||
args.extend(("--ipam-driver", ipam_driver))
|
||||
ipam_config_ls = ipam.get("config", None) or []
|
||||
if net_desc.get("enable_ipv6", None):
|
||||
args.append("--ipv6")
|
||||
|
||||
if is_dict(ipam_config_ls):
|
||||
ipam_config_ls = [ipam_config_ls]
|
||||
for ipam_config in ipam_config_ls:
|
||||
|
@ -26,6 +26,29 @@ class TestGetNetworkCreateArgs(unittest.TestCase):
|
||||
args = get_network_create_args(net_desc, proj_name, net_name)
|
||||
self.assertEqual(args, expected_args)
|
||||
|
||||
def test_ipv6(self):
|
||||
net_desc = {
|
||||
"labels": [],
|
||||
"internal": False,
|
||||
"driver": None,
|
||||
"driver_opts": {},
|
||||
"ipam": {"config": []},
|
||||
"enable_ipv6": True,
|
||||
}
|
||||
proj_name = "test_project"
|
||||
net_name = "test_network"
|
||||
expected_args = [
|
||||
"create",
|
||||
"--label",
|
||||
f"io.podman.compose.project={proj_name}",
|
||||
"--label",
|
||||
f"com.docker.compose.project={proj_name}",
|
||||
"--ipv6",
|
||||
net_name,
|
||||
]
|
||||
args = get_network_create_args(net_desc, proj_name, net_name)
|
||||
self.assertEqual(args, expected_args)
|
||||
|
||||
def test_bridge(self):
|
||||
net_desc = {
|
||||
"labels": [],
|
||||
@ -131,6 +154,7 @@ class TestGetNetworkCreateArgs(unittest.TestCase):
|
||||
"opt2=value2",
|
||||
"--ipam-driver",
|
||||
"default",
|
||||
"--ipv6",
|
||||
"--subnet",
|
||||
"192.168.0.0/24",
|
||||
"--ip-range",
|
||||
|
Loading…
Reference in New Issue
Block a user