diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-09-24 18:47:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-24 18:47:18 +0200 |
commit | b300b981e7b101070198e8d8c9ef5c1c97f0c394 (patch) | |
tree | 60a654b26a40578d0e6bade2ec7bdf11d12457b3 /libpod/oci_internal_linux.go | |
parent | 079dc576de042089b18c097670dfd216c56060e6 (diff) | |
parent | 65d5a9823e0544141b356c77f56cd49cd599e0ba (diff) | |
download | podman-b300b981e7b101070198e8d8c9ef5c1c97f0c394.tar.gz podman-b300b981e7b101070198e8d8c9ef5c1c97f0c394.tar.bz2 podman-b300b981e7b101070198e8d8c9ef5c1c97f0c394.zip |
Merge pull request #3756 from gabibeyer/rootlessOrdering
rootless: Rearrange setup of rootless containers
Diffstat (limited to 'libpod/oci_internal_linux.go')
-rw-r--r-- | libpod/oci_internal_linux.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libpod/oci_internal_linux.go b/libpod/oci_internal_linux.go index a90af32ed..a5cce795b 100644 --- a/libpod/oci_internal_linux.go +++ b/libpod/oci_internal_linux.go @@ -131,9 +131,14 @@ func (r *OCIRuntime) createOCIContainer(ctr *Container, restoreOptions *Containe } if ctr.config.NetMode.IsSlirp4netns() { - ctr.rootlessSlirpSyncR, ctr.rootlessSlirpSyncW, err = os.Pipe() - if err != nil { - return errors.Wrapf(err, "failed to create rootless network sync pipe") + if ctr.config.PostConfigureNetNS { + ctr.rootlessSlirpSyncR, ctr.rootlessSlirpSyncW, err = os.Pipe() + if err != nil { + return errors.Wrapf(err, "failed to create rootless network sync pipe") + } + } else { + defer errorhandling.CloseQuiet(ctr.rootlessSlirpSyncR) + defer errorhandling.CloseQuiet(ctr.rootlessSlirpSyncW) } // Leak one end in conmon, the other one will be leaked into slirp4netns cmd.ExtraFiles = append(cmd.ExtraFiles, ctr.rootlessSlirpSyncW) |