Fix parsing of --network for podman pod create

Interpreting CNI networks was a bit broken, and it was causing
rootless `podman pod create` to fail. Also, we were missing the
`--net` alias for `--network`, so add that.

Fixes #6119

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
This commit is contained in:
Matthew Heon
2020-05-07 15:43:51 -04:00
parent ab518cdba0
commit 2d68dc776d
3 changed files with 26 additions and 29 deletions

View File

@ -33,7 +33,7 @@ func (p *PodSpecGenerator) Validate() error {
}
// PodNetworkConfig
if err := p.NetNS.validate(); err != nil {
if err := validateNetNS(&p.NetNS); err != nil {
return err
}
if p.NoInfra {
@ -85,10 +85,6 @@ func (p *PodSpecGenerator) Validate() error {
return exclusivePodOptions("NoManageHosts", "HostAdd")
}
if err := p.NetNS.validate(); err != nil {
return err
}
// Set Defaults
if p.NetNS.Value == "" {
if rootless.IsRootless() {