mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
runsc: Allow state transition from Creating to Stopped.
This can happen if an error is encountered during Create() which causes the container to be destroyed and set to state Stopped. Without this transition, errors during Create get hidden by the later panic. PiperOrigin-RevId: 215599193 Change-Id: Icd3f42e12c685cbf042f46b3929bccdf30ad55b0
This commit is contained in:
committed by
Shentubot
parent
37e57a903c
commit
7a6412cb0b
@@ -771,7 +771,7 @@ func (c *Container) changeStatus(s Status) {
|
||||
}
|
||||
|
||||
case Stopped:
|
||||
if c.Status != Created && c.Status != Running && c.Status != Stopped {
|
||||
if c.Status != Creating && c.Status != Created && c.Status != Running && c.Status != Stopped {
|
||||
panic(fmt.Sprintf("invalid state transition: %v => %v", c.Status, s))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user