summaryrefslogtreecommitdiff
path: root/libpod/runtime_ctr.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2018-06-26 13:30:39 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-27 13:42:20 +0000
commit80131339b7c34431e382083ef18daa6b85251d64 (patch)
treeb48d79147f4cf368cece65899482feee4429ef4d /libpod/runtime_ctr.go
parentc75f4d4e70bb93e98d0573b6b01b80971b9f880d (diff)
downloadpodman-80131339b7c34431e382083ef18daa6b85251d64.tar.gz
podman-80131339b7c34431e382083ef18daa6b85251d64.tar.bz2
podman-80131339b7c34431e382083ef18daa6b85251d64.zip
Mark containers invalid earlier during removal
Fixes a bug where we might try saving back to the database during cleanup, which would fail as the container was already removed from the database. Signed-off-by: Matthew Heon <mheon@redhat.com> Closes: #1001 Approved by: rhatdan
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r--libpod/runtime_ctr.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index aa49b2d51..932bebdef 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -258,6 +258,9 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool)
}
}
+ // Set container as invalid so it can no longer be used
+ c.valid = false
+
// Clean up network namespace, cgroups, mounts
if err := c.cleanup(); err != nil {
if cleanupErr == nil {
@@ -289,9 +292,6 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool)
}
}
- // Set container as invalid so it can no longer be used
- c.valid = false
-
return cleanupErr
}