From b6176d8987a0049a253fd7a70b2cd8e17bd50b53 Mon Sep 17 00:00:00 2001 From: Ashley Cui Date: Fri, 25 Sep 2020 10:00:43 -0400 Subject: Add support for slirp network for pods flag --network=slirp4netns[options] for root and rootless pods Signed-off-by: Ashley Cui --- pkg/specgen/generate/pod_create.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'pkg/specgen/generate/pod_create.go') diff --git a/pkg/specgen/generate/pod_create.go b/pkg/specgen/generate/pod_create.go index 101201252..43caf0fe9 100644 --- a/pkg/specgen/generate/pod_create.go +++ b/pkg/specgen/generate/pod_create.go @@ -99,6 +99,9 @@ func createPodOptions(p *specgen.PodSpecGenerator, rt *libpod.Runtime) ([]libpod case specgen.Host: logrus.Debugf("Pod will use host networking") options = append(options, libpod.WithPodHostNetwork()) + case specgen.Slirp: + logrus.Debugf("Pod will use slirp4netns") + options = append(options, libpod.WithPodSlirp4netns(p.NetworkOptions)) default: return nil, errors.Errorf("pods presently do not support network mode %s", p.NetNS.NSMode) } -- cgit v1.2.3-54-g00ecf