container: do not pause a StateReady container

We can only pause a running container.

Fixes: #1960
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
Peng Tao 2019-08-06 18:00:15 +08:00
parent 9ea469bcfa
commit 9d4050e0b1

View File

@ -1196,8 +1196,8 @@ func (c *Container) pause() error {
return err return err
} }
if c.state.State != types.StateRunning && c.state.State != types.StateReady { if c.state.State != types.StateRunning {
return fmt.Errorf("Container not running or ready, impossible to pause") return fmt.Errorf("Container not running, impossible to pause")
} }
if err := c.sandbox.agent.pauseContainer(c.sandbox, *c); err != nil { if err := c.sandbox.agent.pauseContainer(c.sandbox, *c); err != nil {