mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-26 10:34:24 +01:00
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:
@@ -1196,8 +1196,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 {
|
||||
|
||||
Reference in New Issue
Block a user