summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/pod_create.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2021-02-01 13:53:14 -0500
committerMatthew Heon <matthew.heon@pm.me>2021-02-02 10:35:23 -0500
commit931ea939ac85bc0e64d12dc34ac920e9e91c4277 (patch)
treee7949abd05b7f8256a23dfc6ba1c5ae1d81cbf4c /pkg/specgen/generate/pod_create.go
parent182e8414d406d3058e985104af98f30a9e8f56fa (diff)
downloadpodman-931ea939ac85bc0e64d12dc34ac920e9e91c4277.tar.gz
podman-931ea939ac85bc0e64d12dc34ac920e9e91c4277.tar.bz2
podman-931ea939ac85bc0e64d12dc34ac920e9e91c4277.zip
Allow pods to use --net=none
We need an extra field in the pod infra container config. We may want to reevaluate that struct at some point, as storing network modes as bools will rapidly become unsustainable, but that's a discussion for another time. Otherwise, straightforward plumbing. Fixes #9165 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/specgen/generate/pod_create.go')
-rw-r--r--pkg/specgen/generate/pod_create.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/specgen/generate/pod_create.go b/pkg/specgen/generate/pod_create.go
index 43caf0fe9..645bf7a47 100644
--- a/pkg/specgen/generate/pod_create.go
+++ b/pkg/specgen/generate/pod_create.go
@@ -102,6 +102,9 @@ func createPodOptions(p *specgen.PodSpecGenerator, rt *libpod.Runtime) ([]libpod
case specgen.Slirp:
logrus.Debugf("Pod will use slirp4netns")
options = append(options, libpod.WithPodSlirp4netns(p.NetworkOptions))
+ case specgen.NoNetwork:
+ logrus.Debugf("Pod will not use networking")
+ options = append(options, libpod.WithPodNoNetwork())
default:
return nil, errors.Errorf("pods presently do not support network mode %s", p.NetNS.NSMode)
}