summaryrefslogtreecommitdiff
path: root/libpod/runtime_ctr.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-01-29 04:59:25 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2018-02-09 15:01:34 +0000
commit4ecebf20b4e41720b9a0b55e0c22f05061c77e60 (patch)
treec1864f919fe7f4290b190ac2f330d97e466af58b /libpod/runtime_ctr.go
parent0920e8de5a08328cceb70617ee04ef177b30d355 (diff)
downloadpodman-4ecebf20b4e41720b9a0b55e0c22f05061c77e60.tar.gz
podman-4ecebf20b4e41720b9a0b55e0c22f05061c77e60.tar.bz2
podman-4ecebf20b4e41720b9a0b55e0c22f05061c77e60.zip
Rework state tests to avoid boilerplate. Begin adding pod tests.
Signed-off-by: Matthew Heon <matthew.heon@gmail.com> Closes: #268 Approved by: rhatdan
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r--libpod/runtime_ctr.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index 942535343..e1c80772e 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -121,8 +121,9 @@ func (r *Runtime) removeContainer(c *Container, force bool) error {
// We need to lock the pod before we lock the container
// To avoid races around removing a container and the pod it is in
var pod *Pod
+ var err error
if c.config.Pod != "" {
- pod, err := r.state.Pod(c.config.Pod)
+ pod, err = r.state.Pod(c.config.Pod)
if err != nil {
return errors.Wrapf(err, "container %s is in pod %s, but pod cannot be retrieved", c.ID(), pod.ID())
}