diff options
author | Matthew Heon <matthew.heon@pm.me> | 2021-02-01 13:53:14 -0500 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2021-02-02 10:35:23 -0500 |
commit | 931ea939ac85bc0e64d12dc34ac920e9e91c4277 (patch) | |
tree | e7949abd05b7f8256a23dfc6ba1c5ae1d81cbf4c /pkg/specgen/generate/pod_create.go | |
parent | 182e8414d406d3058e985104af98f30a9e8f56fa (diff) | |
download | podman-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.go | 3 |
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) } |