mirror of
https://github.com/containers/podman-compose.git
synced 2024-11-21 23:43:24 +01:00
Merge pull request #1002 from nerilex/main
Add `--network=none` if `network_mode: none` is set
This commit is contained in:
commit
b6eadd56b1
1
newsfragments/network-mode-none.bugfix
Normal file
1
newsfragments/network-mode-none.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fix support for `network_mode: none`.
|
@ -876,6 +876,7 @@ def get_net_args(compose, cnt):
|
||||
if net:
|
||||
if net == "none":
|
||||
is_bridge = False
|
||||
net_args.append("--network=none")
|
||||
elif net == "host":
|
||||
net_args.append(f"--network={net}")
|
||||
elif net.startswith("slirp4netns"): # Note: podman-specific network mode
|
||||
|
@ -257,7 +257,7 @@ class TestGetNetArgs(unittest.TestCase):
|
||||
@parameterized.expand([
|
||||
("bridge", ["--network=bridge", f"--network-alias={SERVICE_NAME}"]),
|
||||
("host", ["--network=host"]),
|
||||
("none", []),
|
||||
("none", ["--network=none"]),
|
||||
("slirp4netns", ["--network=slirp4netns"]),
|
||||
("slirp4netns:cidr=10.42.0.0/24", ["--network=slirp4netns:cidr=10.42.0.0/24"]),
|
||||
("private", ["--network=private"]),
|
||||
|
Loading…
Reference in New Issue
Block a user