summaryrefslogtreecommitdiffhomepage
path: root/runsc/container/container.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-09-05 14:01:25 -0700
committerShentubot <shentubot@google.com>2018-09-05 14:02:45 -0700
commit0c7cfca0da234ae34497c420a23fea91a47a566c (patch)
tree07e837d8a6717dba1c3e5289a3ef89b06f13939f /runsc/container/container.go
parent4b57fd920d2d9fe3c8351d5b73b496902c928d95 (diff)
Running container should have a valid sandbox
PiperOrigin-RevId: 211693868 Change-Id: Iea340dd78bf26ae6409c310b63c17cc611c2055f
Diffstat (limited to 'runsc/container/container.go')
-rw-r--r--runsc/container/container.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/runsc/container/container.go b/runsc/container/container.go
index 725b4d347..a3454eb8f 100644
--- a/runsc/container/container.go
+++ b/runsc/container/container.go
@@ -517,6 +517,7 @@ func (c *Container) Destroy() error {
log.Warningf("Failed to destroy sandbox %q: %v", c.Sandbox.ID, err)
}
}
+ c.Status = Stopped
c.Sandbox = nil
if c.GoferPid != 0 {
@@ -536,15 +537,11 @@ func (c *Container) Destroy() error {
return fmt.Errorf("error deleting container root directory %q: %v", c.Root, err)
}
- c.Status = Stopped
return nil
}
// IsRunning returns true if the sandbox or gofer process is running.
func (c *Container) IsRunning() bool {
- if c.Status == Stopped {
- return false
- }
if c.Sandbox != nil && c.Sandbox.IsRunning() {
return true
}