summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNicolas Lacasse <nlacasse@google.com>2018-10-03 11:48:30 -0700
committerShentubot <shentubot@google.com>2018-10-03 11:49:40 -0700
commit7a6412cb0b4e52bf175a77b5f43d4a74547e9798 (patch)
treeda318cebc9458992737d71768b8d9dd326681200
parent37e57a903cf0d40e53a97eb3d47036024d7536c3 (diff)
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
-rw-r--r--runsc/container/container.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/runsc/container/container.go b/runsc/container/container.go
index 4b0037b4e..827528349 100644
--- a/runsc/container/container.go
+++ b/runsc/container/container.go
@@ -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))
}