mirror of
https://github.com/docker/cli.git
synced 2026-09-27 17:56:04 -04:00
Fail the container start if the network has been removed
Signed-off-by: Madhu Venugopal <madhu@docker.com> Upstream-commit: 8755920d0d1b3ef0d094bd75b25018b06d19839a Component: engine
This commit is contained in:
@@ -894,11 +894,7 @@ func (container *Container) allocateNetwork() error {
|
||||
|
||||
for _, n := range settings {
|
||||
if err := container.connectToNetwork(n, updateSettings); err != nil {
|
||||
if updateSettings {
|
||||
return err
|
||||
}
|
||||
// dont fail a container restart case if the user removed the network
|
||||
logrus.Warnf("Could not connect container %s : %v", container.ID, err)
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user