Merge pull request #1126 from jcvenegas/allow-update-on-ready

update: allow do update on ready.
This commit is contained in:
Frank Cao 2019-01-18 11:03:12 +08:00 committed by GitHub
commit 6c3277e013
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -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{

View File

@ -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 {