1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #18905 from coolljt0725/fix_disconnect_not_save

Fix network disconnect does not save the config to disk
This commit is contained in:
David Calavera 2015-12-28 12:38:16 -08:00
commit 1d4306d2fa

View file

@ -711,15 +711,17 @@ func (daemon *Daemon) DisconnectFromNetwork(container *container.Container, n li
return runconfig.ErrConflictHostNetwork
}
return disconnectFromNetwork(container, n)
}
func disconnectFromNetwork(container *container.Container, n libnetwork.Network) error {
if err := disconnectFromNetwork(container, n); err != nil {
return err
}
if err := container.ToDiskLocking(); err != nil {
return fmt.Errorf("Error saving container to disk: %v", err)
}
return nil
}
func disconnectFromNetwork(container *container.Container, n libnetwork.Network) error {
var (
ep libnetwork.Endpoint
sbox libnetwork.Sandbox