Merge pull request #13390 from mrjana/cnm_integ
Do not attempt releasing network when not attached to any network
This commit is contained in:
commit
b445004364
|
@ -903,6 +903,12 @@ func (container *Container) ReleaseNetwork() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the container is not attached to any network do not try
|
||||||
|
// to release network and generate spurious error messages.
|
||||||
|
if container.NetworkSettings.NetworkID == "" {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
n, err := container.daemon.netController.NetworkByID(container.NetworkSettings.NetworkID)
|
n, err := container.daemon.netController.NetworkByID(container.NetworkSettings.NetworkID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logrus.Errorf("error locating network id %s: %v", container.NetworkSettings.NetworkID, err)
|
logrus.Errorf("error locating network id %s: %v", container.NetworkSettings.NetworkID, err)
|
||||||
|
|
Loading…
Reference in New Issue