Merge pull request #19952 from WeiZhang555/fix-err-restarting-1
Fix error message for pause a restarting container Upstream-commit: dcde68b955a8f75119573ec6011cb1b1a9457f60 Component: engine
This commit is contained in:
@@ -35,6 +35,11 @@ func (daemon *Daemon) containerPause(container *container.Container) error {
|
||||
return derr.ErrorCodeAlreadyPaused.WithArgs(container.ID)
|
||||
}
|
||||
|
||||
// We cannot Pause the container which is restarting
|
||||
if container.Restarting {
|
||||
return derr.ErrorCodeContainerRestarting.WithArgs(container.ID)
|
||||
}
|
||||
|
||||
if err := daemon.execDriver.Pause(container.Command); err != nil {
|
||||
return derr.ErrorCodeCantPause.WithArgs(container.ID, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user