Skip to content

Commit

Permalink
Fix network disconnect does not save the config to disk
Browse files Browse the repository at this point in the history
Signed-off-by: Lei Jitang <[email protected]>
  • Loading branch information
coolljt0725 committed Dec 25, 2015
1 parent d1b7d58 commit c0bde4e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions daemon/container_operations_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c0bde4e

Please sign in to comment.