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:
commit
1d4306d2fa
1 changed files with 6 additions and 4 deletions
|
@ -711,15 +711,17 @@ func (daemon *Daemon) DisconnectFromNetwork(container *container.Container, n li
|
|||
return runconfig.ErrConflictHostNetwork
|
||||
}
|
||||
|
||||
return disconnectFromNetwork(container, n)
|
||||
if err := disconnectFromNetwork(container, n); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
func disconnectFromNetwork(container *container.Container, n libnetwork.Network) error {
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue