diff options
author | baude <bbaude@redhat.com> | 2019-07-03 15:37:17 -0500 |
---|---|---|
committer | baude <bbaude@redhat.com> | 2019-07-08 09:18:11 -0500 |
commit | 1d36501f961889f554daf3c696fe95443ef211b6 (patch) | |
tree | 4a8d7aa79f46a0096ad7952f1390d6909a9d894b /libpod/runtime_ctr.go | |
parent | f7407f2eb512e1407f8281009eb829f37405119b (diff) | |
download | podman-1d36501f961889f554daf3c696fe95443ef211b6.tar.gz podman-1d36501f961889f554daf3c696fe95443ef211b6.tar.bz2 podman-1d36501f961889f554daf3c696fe95443ef211b6.zip |
code cleanup
clean up code identified as problematic by golands inspection
Signed-off-by: baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/runtime_ctr.go')
-rw-r--r-- | libpod/runtime_ctr.go | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go index 9daac161c..d022478b1 100644 --- a/libpod/runtime_ctr.go +++ b/libpod/runtime_ctr.go @@ -430,22 +430,17 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool, // If we're removing the pod, the container will be evicted // from the state elsewhere if !removePod { - if err := r.state.RemoveContainerFromPod(pod, c); err != nil { - if cleanupErr == nil { - cleanupErr = err - } else { - logrus.Errorf("removing container from pod: %v", err) - } - } - } - } else { - if err := r.state.RemoveContainer(c); err != nil { if cleanupErr == nil { cleanupErr = err } else { - logrus.Errorf("removing container: %v", err) + logrus.Errorf("removing container from pod: %v", err) } } + } else { + if err := r.state.RemoveContainer(c); err != nil { + cleanupErr = err + } + logrus.Errorf("removing container: %v", err) } // Set container as invalid so it can no longer be used |