diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-08 20:02:42 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 20:02:42 +0200 |
commit | b2e8915baa22098fbde39b73ad0f18326ec2842b (patch) | |
tree | 46602b322a8a10d1697d8f6c14027db3109c9164 /pkg/specgen/pod_validate.go | |
parent | 428246d4e48a5b3ac1c499fed8d82276195a4ec9 (diff) | |
parent | 7989e422b404c2fe182dac5154fbfe218c561b93 (diff) | |
download | podman-b2e8915baa22098fbde39b73ad0f18326ec2842b.tar.gz podman-b2e8915baa22098fbde39b73ad0f18326ec2842b.tar.bz2 podman-b2e8915baa22098fbde39b73ad0f18326ec2842b.zip |
Merge pull request #6144 from mheon/fix_pod_create_noinfra
Fix `podman pod create --infra=false`
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 } |