diff --git a/cli/update.go b/cli/update.go index 4a25fbe9c..edbe5262b 100644 --- a/cli/update.go +++ b/cli/update.go @@ -165,8 +165,8 @@ other options are ignored. span.SetTag("sandbox", sandboxID) // container MUST be running - if status.State.State != types.StateRunning { - return fmt.Errorf("Container %s is not running", containerID) + if state := status.State.State; !(state == types.StateRunning || state == types.StateReady) { + return fmt.Errorf("Container %s is not running or Ready, the state is %s", containerID, state) } r := specs.LinuxResources{ diff --git a/virtcontainers/container.go b/virtcontainers/container.go index db9715e97..5e1cb9657 100644 --- a/virtcontainers/container.go +++ b/virtcontainers/container.go @@ -1029,8 +1029,8 @@ func (c *Container) update(resources specs.LinuxResources) error { return err } - if c.state.State != types.StateRunning { - return fmt.Errorf("Container not running, impossible to update") + if state := c.state.State; !(state == types.StateRunning || state == types.StateReady) { + return fmt.Errorf("Container(%s) not running or ready, impossible to update", state) } if c.config.Resources.CPU == nil {