summaryrefslogtreecommitdiff
path: root/cmd/podman/spec.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/podman/spec.go')
-rw-r--r--cmd/podman/spec.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/podman/spec.go b/cmd/podman/spec.go
index d18da79ea..0b5a3c3e3 100644
--- a/cmd/podman/spec.go
+++ b/cmd/podman/spec.go
@@ -572,7 +572,8 @@ func (c *createConfig) GetContainerCreateOptions() ([]libpod.CtrCreateOption, er
return nil, errors.Wrapf(err, "container %q not found", c.NetMode.ConnectedContainer())
}
options = append(options, libpod.WithNetNSFrom(connectedCtr))
- } else if !c.NetMode.IsHost() {
+ } else if !c.NetMode.IsHost() && !c.NetMode.IsNone() {
+ options = append(options, libpod.WithNetNS([]ocicni.PortMapping{}))
options = append(options, libpod.WithNetNS(portBindings))
}