diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-11-26 21:31:06 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-11-28 09:21:59 +0100 |
commit | 95f22a2ca055d6dec0281cee109375dc4fd9b78b (patch) | |
tree | fb916a4b5e4960cada05db5c57f2aae5175009f2 /libpod/runtime_pod_infra_linux.go | |
parent | 4203df69aca13f14e43ad32a9b7ffb6cfb8c1016 (diff) | |
download | podman-95f22a2ca055d6dec0281cee109375dc4fd9b78b.tar.gz podman-95f22a2ca055d6dec0281cee109375dc4fd9b78b.tar.bz2 podman-95f22a2ca055d6dec0281cee109375dc4fd9b78b.zip |
network: allow slirp4netns mode also for root containers
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/runtime_pod_infra_linux.go')
-rw-r--r-- | libpod/runtime_pod_infra_linux.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libpod/runtime_pod_infra_linux.go b/libpod/runtime_pod_infra_linux.go index 450a2fb32..8a5dbef56 100644 --- a/libpod/runtime_pod_infra_linux.go +++ b/libpod/runtime_pod_infra_linux.go @@ -50,7 +50,11 @@ func (r *Runtime) makeInfraContainer(ctx context.Context, p *Pod, imgName, imgID // Since user namespace sharing is not implemented, we only need to check if it's rootless networks := make([]string, 0) - options = append(options, WithNetNS(p.config.InfraContainer.PortBindings, isRootless, networks)) + netmode := "bridge" + if isRootless { + netmode = "slirp4netns" + } + options = append(options, WithNetNS(p.config.InfraContainer.PortBindings, isRootless, netmode, networks)) return r.newContainer(ctx, g.Config, options...) } |