mirror of
https://github.com/containers/podman.git
synced 2025-10-19 04:03:23 +08:00
Merge pull request #4853 from mheon/do_not_configure_with_slirp
Do not configure CNI when slirp4netns is requested
This commit is contained in:
@ -148,7 +148,7 @@ func (r *Runtime) createNetNS(ctr *Container) (n ns.NetNS, q []*cnitypes.Result,
|
|||||||
logrus.Debugf("Made network namespace at %s for container %s", ctrNS.Path(), ctr.ID())
|
logrus.Debugf("Made network namespace at %s for container %s", ctrNS.Path(), ctr.ID())
|
||||||
|
|
||||||
networkStatus := []*cnitypes.Result{}
|
networkStatus := []*cnitypes.Result{}
|
||||||
if !rootless.IsRootless() {
|
if !rootless.IsRootless() && ctr.config.NetMode != "slirp4netns" {
|
||||||
networkStatus, err = r.configureNetNS(ctr, ctrNS)
|
networkStatus, err = r.configureNetNS(ctr, ctrNS)
|
||||||
}
|
}
|
||||||
return ctrNS, networkStatus, err
|
return ctrNS, networkStatus, err
|
||||||
@ -462,7 +462,7 @@ func (r *Runtime) teardownNetNS(ctr *Container) error {
|
|||||||
logrus.Debugf("Tearing down network namespace at %s for container %s", ctr.state.NetNS.Path(), ctr.ID())
|
logrus.Debugf("Tearing down network namespace at %s for container %s", ctr.state.NetNS.Path(), ctr.ID())
|
||||||
|
|
||||||
// rootless containers do not use the CNI plugin
|
// rootless containers do not use the CNI plugin
|
||||||
if !rootless.IsRootless() {
|
if !rootless.IsRootless() && ctr.config.NetMode != "slirp4netns" {
|
||||||
var requestedIP net.IP
|
var requestedIP net.IP
|
||||||
if ctr.requestedIP != nil {
|
if ctr.requestedIP != nil {
|
||||||
requestedIP = ctr.requestedIP
|
requestedIP = ctr.requestedIP
|
||||||
|
Reference in New Issue
Block a user