Skip to content

Commit

Permalink
Fix restore active sandbox
Browse files Browse the repository at this point in the history
we store the active sandbox after daemon.containerd.Restore, but there
is a chance the `Restore` will set the container to exit see
(https://github.com/docker/docker/blob/master/libcontainerd/client_linux.go#L469).
so we should check if the container is really running before add it to
activesandbox.

Signed-off-by: Lei Jitang <[email protected]>
(cherry picked from commit 78f3094)
  • Loading branch information
coolljt0725 authored and Tibor Vass committed Jun 17, 2016
1 parent 1ad7b51 commit 83fbaa3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func (daemon *Daemon) restore() error {
logrus.Errorf("Failed to restore with containerd: %q", err)
return
}
if !c.HostConfig.NetworkMode.IsContainer() {
if !c.HostConfig.NetworkMode.IsContainer() && c.IsRunning() {
options, err := daemon.buildSandboxOptions(c)
if err != nil {
logrus.Warnf("Failed build sandbox option to restore container %s: %v", c.ID, err)
Expand Down

0 comments on commit 83fbaa3

Please sign in to comment.