Skip to content

Commit 1286960

Browse files
committed
Update for stopped container
Signed-off-by: rajasec <[email protected]>
1 parent afaa21f commit 1286960

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
@@ -174,6 +174,13 @@ func (c *linuxContainer) Stats() (*Stats, error) {
174174
func (c *linuxContainer) Set(config configs.Config) error {
175175
c.m.Lock()
176176
defer c.m.Unlock()
177+
status, err := c.currentStatus()
178+
if err != nil {
179+
return err
180+
}
181+
if status == Stopped {
182+
return newGenericError(fmt.Errorf("container not running"), ContainerNotRunning)
183+
}
177184
c.config = &config
178185
return c.cgroupManager.Set(c.config)
179186
}

0 commit comments

Comments
 (0)