fix #29199, reset container if container start failed
Signed-off-by: Lei Jitang <leijitang@huawei.com> Upstream-commit: e806821b53f9ca1f1a3d933e7bbfe04a5566a3bf Component: engine
This commit is contained in:
@@ -119,6 +119,9 @@ func (daemon *Daemon) containerStart(container *container.Container, checkpoint
|
||||
container.SetExitCode(128)
|
||||
}
|
||||
container.ToDisk()
|
||||
|
||||
container.Reset(false)
|
||||
|
||||
daemon.Cleanup(container)
|
||||
// if containers AutoRemove flag is set, remove it after clean up
|
||||
if container.HostConfig.AutoRemove {
|
||||
@@ -187,8 +190,6 @@ func (daemon *Daemon) containerStart(container *container.Container, checkpoint
|
||||
container.SetExitCode(127)
|
||||
}
|
||||
|
||||
container.Reset(false)
|
||||
|
||||
return fmt.Errorf("%s", errDesc)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user