summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLantao Liu <lantaol@google.com>2018-09-20 11:21:59 -0700
committerShentubot <shentubot@google.com>2018-09-20 11:23:26 -0700
commit9464b82a067df93101e77bd51800364671d7f032 (patch)
tree18c66b820891253d55ee964b396aa0b8e97d0e31
parentffb5fdd69021713e88ec965e77487b7fc28bc104 (diff)
runsc: Fix a bug that `runsc wait` doesn't work after container exits.
PiperOrigin-RevId: 213849165 Change-Id: I5120b2f568850c0c42a08e8706e7f8653ef1bd94
-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 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))