summaryrefslogtreecommitdiff
path: root/libpod/runtime_pod_infra_linux.go
diff options
context:
space:
mode:
authorAshley Cui <acui@redhat.com>2020-09-25 10:00:43 -0400
committerAshley Cui <acui@redhat.com>2020-09-25 21:34:23 -0400
commitb6176d8987a0049a253fd7a70b2cd8e17bd50b53 (patch)
treee4ce740ebc925079ab223b41acec4c15b85b6fd9 /libpod/runtime_pod_infra_linux.go
parent98aa458c7a13c72fabe02cd0ed2919c2801ef207 (diff)
downloadpodman-b6176d8987a0049a253fd7a70b2cd8e17bd50b53.tar.gz
podman-b6176d8987a0049a253fd7a70b2cd8e17bd50b53.tar.bz2
podman-b6176d8987a0049a253fd7a70b2cd8e17bd50b53.zip
Add support for slirp network for pods
flag --network=slirp4netns[options] for root and rootless pods Signed-off-by: Ashley Cui <acui@redhat.com>
Diffstat (limited to 'libpod/runtime_pod_infra_linux.go')
-rw-r--r--libpod/runtime_pod_infra_linux.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/libpod/runtime_pod_infra_linux.go b/libpod/runtime_pod_infra_linux.go
index 164068638..e8e71afd1 100644
--- a/libpod/runtime_pod_infra_linux.go
+++ b/libpod/runtime_pod_infra_linux.go
@@ -77,8 +77,11 @@ func (r *Runtime) makeInfraContainer(ctx context.Context, p *Pod, imgName, rawIm
// Since user namespace sharing is not implemented, we only need to check if it's rootless
if !p.config.InfraContainer.HostNetwork {
netmode := "bridge"
- if isRootless {
+ if isRootless || p.config.InfraContainer.Slirp4netns {
netmode = "slirp4netns"
+ if len(p.config.InfraContainer.NetworkOptions) != 0 {
+ options = append(options, WithNetworkOptions(p.config.InfraContainer.NetworkOptions))
+ }
}
// PostConfigureNetNS should not be set since user namespace sharing is not implemented
// and rootless networking no longer supports post configuration setup