Merge pull request #881 from rajasec/update-status
Update for stopped container
This commit is contained in:
commit
f5b6ff23b8
|
@ -170,6 +170,13 @@ func (c *linuxContainer) Stats() (*Stats, error) {
|
|||
func (c *linuxContainer) Set(config configs.Config) error {
|
||||
c.m.Lock()
|
||||
defer c.m.Unlock()
|
||||
status, err := c.currentStatus()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if status == Stopped {
|
||||
return newGenericError(fmt.Errorf("container not running"), ContainerNotRunning)
|
||||
}
|
||||
c.config = &config
|
||||
return c.cgroupManager.Set(c.config)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue