summaryrefslogtreecommitdiff
path: root/pkg
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-04 14:26:57 -0500
commit6bd3a6bcabda682243f531bacf3659b95da8590a (patch)
tree6c66f4137ea9320e47bfd0b827c1d7e9b6892516 /pkg
parentb576ddd9a2ebfa8b42777114ddc1fcc248d6d7fb (diff)
downloadpodman-6bd3a6bcabda682243f531bacf3659b95da8590a.tar.gz
podman-6bd3a6bcabda682243f531bacf3659b95da8590a.tar.bz2
podman-6bd3a6bcabda682243f531bacf3659b95da8590a.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')
-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)
}