mirror of https://github.com/containers/podman.git
rootless: raise an error with --network=
Closes: https://github.com/containers/libpod/issues/4332 Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
ef556cfecf
commit
8f75b3e8c9
|
@ -1014,6 +1014,13 @@ func WithNetNS(portMappings []ocicni.PortMapping, postConfigureNetNS bool, netmo
|
||||||
ctr.config.NetMode = namespaces.NetworkMode(netmode)
|
ctr.config.NetMode = namespaces.NetworkMode(netmode)
|
||||||
ctr.config.CreateNetNS = true
|
ctr.config.CreateNetNS = true
|
||||||
ctr.config.PortMappings = portMappings
|
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
|
ctr.config.Networks = networks
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in New Issue