From 9464b82a067df93101e77bd51800364671d7f032 Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Thu, 20 Sep 2018 11:21:59 -0700 Subject: runsc: Fix a bug that `runsc wait` doesn't work after container exits. PiperOrigin-RevId: 213849165 Change-Id: I5120b2f568850c0c42a08e8706e7f8653ef1bd94 --- runsc/container/container.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runsc') diff --git a/runsc/container/container.go b/runsc/container/container.go index a2582611a..32f2dd31a 100644 --- a/runsc/container/container.go +++ b/runsc/container/container.go @@ -139,6 +139,7 @@ func Load(rootDir, id string) (*Container, error) { if !c.Sandbox.IsRunning() { // Sandbox no longer exists, so this container definitely does not exist. c.changeStatus(Stopped) + c.Sandbox = nil } else if c.Status == Running { // Container state should reflect the actual state of // the application, so we don't consider gofer process @@ -682,7 +683,6 @@ func (c *Container) changeStatus(s Status) { if c.Status != Created && c.Status != Running && c.Status != Stopped { panic(fmt.Sprintf("invalid state transition: %v => %v", c.Status, s)) } - c.Sandbox = nil default: panic(fmt.Sprintf("invalid new state: %v", s)) -- cgit v1.2.3