Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
container: do not pause a StateReady container
Browse files Browse the repository at this point in the history
We can only pause a running container.

Fixes: #1960
Signed-off-by: Peng Tao <[email protected]>
  • Loading branch information
bergwolf authored and Eric Ernst committed Aug 29, 2019
1 parent e1be326 commit 7a690b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions virtcontainers/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -1202,8 +1202,8 @@ func (c *Container) pause() error {
return err
}

if c.state.State != types.StateRunning && c.state.State != types.StateReady {
return fmt.Errorf("Container not running or ready, impossible to pause")
if c.state.State != types.StateRunning {
return fmt.Errorf("Container not running, impossible to pause")
}

if err := c.sandbox.agent.pauseContainer(c.sandbox, *c); err != nil {
Expand Down

0 comments on commit 7a690b0

Please sign in to comment.