diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-06-11 08:55:50 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-11 08:55:50 -0400 |
commit | 1060a94efbecdb2461d8005d6cc79976eaeee5ac (patch) | |
tree | 6d0c2e28b4123f68cc8c534ee748e3b9fdf452e5 /libpod/container_internal_linux.go | |
parent | b62e50f53b9e65c86e877bb931fa53602eba53c7 (diff) | |
parent | 8ef1b461ae4187cc508cc8d9b73d68d04503467f (diff) | |
download | podman-1060a94efbecdb2461d8005d6cc79976eaeee5ac.tar.gz podman-1060a94efbecdb2461d8005d6cc79976eaeee5ac.tar.bz2 podman-1060a94efbecdb2461d8005d6cc79976eaeee5ac.zip |
Merge pull request #6568 from giuseppe/fix-check-for-rootless-net
libpod: fix check for slirp4netns netns
Diffstat (limited to 'libpod/container_internal_linux.go')
-rw-r--r-- | libpod/container_internal_linux.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index e3ca3f6b2..9afe11b2b 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -79,7 +79,8 @@ func (c *Container) prepare() error { go func() { defer wg.Done() // Set up network namespace if not already set up - if c.config.CreateNetNS && c.state.NetNS == nil && !c.config.PostConfigureNetNS { + noNetNS := c.state.NetNS == nil + if c.config.CreateNetNS && noNetNS && !c.config.PostConfigureNetNS { netNS, networkStatus, createNetNSErr = c.runtime.createNetNS(c) if createNetNSErr != nil { return @@ -94,7 +95,7 @@ func (c *Container) prepare() error { } // handle rootless network namespace setup - if c.state.NetNS != nil && c.config.NetMode.IsSlirp4netns() && !c.config.PostConfigureNetNS { + if noNetNS && c.config.NetMode.IsSlirp4netns() && !c.config.PostConfigureNetNS { createNetNSErr = c.runtime.setupRootlessNetNS(c) } }() |