mirror of https://github.com/containers/podman.git
Merge pull request #4333 from giuseppe/error-rootless-cni
rootless: raise an error with --network=
This commit is contained in:
commit
77c7a28a72
|
@ -1014,6 +1014,13 @@ func WithNetNS(portMappings []ocicni.PortMapping, postConfigureNetNS bool, netmo
|
|||
ctr.config.NetMode = namespaces.NetworkMode(netmode)
|
||||
ctr.config.CreateNetNS = true
|
||||
ctr.config.PortMappings = portMappings
|
||||
|
||||
if rootless.IsRootless() {
|
||||
if len(networks) > 0 {
|
||||
return errors.New("cannot use CNI networks with rootless containers")
|
||||
}
|
||||
}
|
||||
|
||||
ctr.config.Networks = networks
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue