mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
runsc: do not delete in paused state.
PiperOrigin-RevId: 211835570 Change-Id: Ied7933732cad5bc60b762e9c964986cb49a8d9b9
This commit is contained in:
+2
-2
@@ -76,8 +76,8 @@ func (d *Delete) execute(ids []string, conf *boot.Config) error {
|
||||
}
|
||||
return fmt.Errorf("error loading container %q: %v", id, err)
|
||||
}
|
||||
if !d.force && (c.Status == container.Running) {
|
||||
return fmt.Errorf("cannot stop running container without --force flag")
|
||||
if !d.force && c.Status != container.Created && c.Status != container.Stopped {
|
||||
return fmt.Errorf("cannot delete container that is not stopped without --force flag")
|
||||
}
|
||||
if err := c.Destroy(); err != nil {
|
||||
return fmt.Errorf("error destroying container: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user