Merge pull request #881 from rajasec/update-status

Update for stopped container
This commit is contained in:
Mrunal Patel 2016-06-13 16:05:25 -07:00 committed by GitHub
commit f5b6ff23b8
1 changed files with 7 additions and 0 deletions

View File

@ -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)
}