mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-03 18:47:03 +00:00
Merge pull request #1126 from jcvenegas/allow-update-on-ready
update: allow do update on ready.
This commit is contained in:
commit
6c3277e013
@ -165,8 +165,8 @@ other options are ignored.
|
|||||||
span.SetTag("sandbox", sandboxID)
|
span.SetTag("sandbox", sandboxID)
|
||||||
|
|
||||||
// container MUST be running
|
// container MUST be running
|
||||||
if status.State.State != types.StateRunning {
|
if state := status.State.State; !(state == types.StateRunning || state == types.StateReady) {
|
||||||
return fmt.Errorf("Container %s is not running", containerID)
|
return fmt.Errorf("Container %s is not running or Ready, the state is %s", containerID, state)
|
||||||
}
|
}
|
||||||
|
|
||||||
r := specs.LinuxResources{
|
r := specs.LinuxResources{
|
||||||
|
@ -1029,8 +1029,8 @@ func (c *Container) update(resources specs.LinuxResources) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.state.State != types.StateRunning {
|
if state := c.state.State; !(state == types.StateRunning || state == types.StateReady) {
|
||||||
return fmt.Errorf("Container not running, impossible to update")
|
return fmt.Errorf("Container(%s) not running or ready, impossible to update", state)
|
||||||
}
|
}
|
||||||
|
|
||||||
if c.config.Resources.CPU == nil {
|
if c.config.Resources.CPU == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user