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:
Nicolas Lacasse
2018-10-03 11:49:40 -07:00
committed by Shentubot
parent 37e57a903c
commit 7a6412cb0b
+1 -1
View File
@@ -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))
}