Merge pull request #19952 from WeiZhang555/fix-err-restarting-1

Fix error message for pause a restarting container
This commit is contained in:
Jess Frazelle 2016-02-03 17:34:19 -08:00
commit dcde68b955

View file

@ -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)
}