diff options
author | Matthew Heon <matthew.heon@pm.me> | 2020-05-08 13:25:41 -0400 |
---|---|---|
committer | Matthew Heon <matthew.heon@pm.me> | 2020-05-08 13:25:41 -0400 |
commit | 7989e422b404c2fe182dac5154fbfe218c561b93 (patch) | |
tree | f6c398b04ea5c5cd863ab8d2643607df4f4c96bb /pkg/specgen/pod_validate.go | |
parent | 13db0f2b61b17e6f959fff832b40270352cd54da (diff) | |
download | podman-7989e422b404c2fe182dac5154fbfe218c561b93.tar.gz podman-7989e422b404c2fe182dac5154fbfe218c561b93.tar.bz2 podman-7989e422b404c2fe182dac5154fbfe218c561b93.zip |
Fix `podman pod create --infra=false`
We were accidentally setting incorrect defaults for the network
namespace for rootless `pod create` when infra containers were
not being created. This should resolve that issue.
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'pkg/specgen/pod_validate.go')
-rw-r--r-- | pkg/specgen/pod_validate.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/pkg/specgen/pod_validate.go b/pkg/specgen/pod_validate.go index 08f1c0300..640447e71 100644 --- a/pkg/specgen/pod_validate.go +++ b/pkg/specgen/pod_validate.go @@ -1,7 +1,6 @@ package specgen import ( - "github.com/containers/libpod/pkg/rootless" "github.com/containers/libpod/pkg/util" "github.com/pkg/errors" ) @@ -37,8 +36,8 @@ func (p *PodSpecGenerator) Validate() error { return err } if p.NoInfra { - if p.NetNS.NSMode == NoNetwork { - return errors.New("NoInfra and a none network cannot be used toegther") + if p.NetNS.NSMode != Default && p.NetNS.NSMode != "" { + return errors.New("NoInfra and network modes cannot be used toegther") } if p.StaticIP != nil { return exclusivePodOptions("NoInfra", "StaticIP") @@ -86,13 +85,6 @@ func (p *PodSpecGenerator) Validate() error { } // Set Defaults - if p.NetNS.Value == "" { - if rootless.IsRootless() { - p.NetNS.NSMode = Slirp - } else { - p.NetNS.NSMode = Bridge - } - } if len(p.InfraImage) < 1 { p.InfraImage = containerConfig.Engine.InfraImage } |