From beb263554efdb849291caf5dba4a74966564b78d Mon Sep 17 00:00:00 2001 From: Matthew Heon Date: Thu, 28 Mar 2019 17:39:56 -0400 Subject: Ensure that we make a netns for CNI non-default nets We accidentally patched this out trying to enable ns:/path/to/ns This should restore the ability to configure nondefault CNI networks with Podman, by ensuring that they request creation of a network namespace. Completely remove the WithNetNS() call when we do use an explicit namespace from a path. We use that call to indicate that a netns is going to be created - there should not be any question about whether it actually does. Fixes #2795 Signed-off-by: Matthew Heon --- libpod/options.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpod/options.go') diff --git a/libpod/options.go b/libpod/options.go index e1ffd6ea5..84c541314 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -930,7 +930,7 @@ func WithNetNS(portMappings []ocicni.PortMapping, postConfigureNetNS bool, netmo ctr.config.PostConfigureNetNS = postConfigureNetNS ctr.config.NetMode = namespaces.NetworkMode(netmode) - ctr.config.CreateNetNS = !ctr.config.NetMode.IsUserDefined() + ctr.config.CreateNetNS = true ctr.config.PortMappings = portMappings ctr.config.Networks = networks -- cgit v1.2.3-54-g00ecf