Skip to content

Commit f5b6ff2

Browse files
author
Mrunal Patel
authored
Merge pull request #881 from rajasec/update-status
Update for stopped container
2 parents 96c15e6 + 1286960 commit f5b6ff2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libcontainer/container_linux.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ func (c *linuxContainer) Stats() (*Stats, error) {
170170
func (c *linuxContainer) Set(config configs.Config) error {
171171
c.m.Lock()
172172
defer c.m.Unlock()
173+
status, err := c.currentStatus()
174+
if err != nil {
175+
return err
176+
}
177+
if status == Stopped {
178+
return newGenericError(fmt.Errorf("container not running"), ContainerNotRunning)
179+
}
173180
c.config = &config
174181
return c.cgroupManager.Set(c.config)
175182
}

0 commit comments

Comments
 (0)