Merge pull request #4157 from giuseppe/slirp4netns-workaround

network: add workaround for slirp4netns --enable-sandbox issue
This commit is contained in:
OpenShift Merge Robot 2019-10-01 08:42:10 -07:00 committed by GitHub
commit abb1523210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -201,6 +201,12 @@ func (r *Runtime) setupRootlessNetNS(ctr *Container) (err error) {
Setpgid: true,
}
// workaround for https://github.com/rootless-containers/slirp4netns/pull/153
if sandbox {
cmd.SysProcAttr.Cloneflags = syscall.CLONE_NEWNS
cmd.SysProcAttr.Unshareflags = syscall.CLONE_NEWNS
}
// Leak one end of the pipe in slirp4netns, the other will be sent to conmon
cmd.ExtraFiles = append(cmd.ExtraFiles, ctr.rootlessSlirpSyncR, syncW)