mirror of
https://github.com/containers/podman-compose.git
synced 2025-08-14 15:58:42 +02:00
Add network "disable-dns" support
Podman allows to create a network disabling the DNS plugin with '--disable-dns', but this option is not available in the compose spec. This patch add 'x-podman.disable-dns' to the podman-compose options, allowing the creation of a network with the DNS plugin disabled. Signed-off-by: Rafael Guterres Jeffman <rjeffman@redhat.com>
This commit is contained in:
@ -201,3 +201,27 @@ class TestGetNetworkCreateArgs(unittest.TestCase):
|
||||
]
|
||||
args = get_network_create_args(net_desc, proj_name, net_name)
|
||||
self.assertEqual(args, expected_args)
|
||||
|
||||
def test_disable_dns(self):
|
||||
net_desc = {
|
||||
"labels": [],
|
||||
"internal": False,
|
||||
"driver": None,
|
||||
"driver_opts": {},
|
||||
"ipam": {"config": []},
|
||||
"enable_ipv6": False,
|
||||
"x-podman.disable_dns": 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}",
|
||||
"--disable-dns",
|
||||
net_name,
|
||||
]
|
||||
args = get_network_create_args(net_desc, proj_name, net_name)
|
||||
self.assertEqual(args, expected_args)
|
||||
|
Reference in New Issue
Block a user