aboutsummaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@pm.me>2019-07-11 10:17:33 -0400
committerMatthew Heon <matthew.heon@pm.me>2019-07-11 10:17:33 -0400
commit8713483362904911c699d1cb3bdfcbd6694f30a2 (patch)
treec8d54ec418c661fd7b6be3ce49df36d37fd9037f /libpod
parentdf3f5afad13c91a6f2be9e83ae328483e047c13c (diff)
downloadpodman-8713483362904911c699d1cb3bdfcbd6694f30a2.tar.gz
podman-8713483362904911c699d1cb3bdfcbd6694f30a2.tar.bz2
podman-8713483362904911c699d1cb3bdfcbd6694f30a2.zip
Fix a bug where ctrs could not be removed from pods
Using pod removal worked, but container removal was missing the most critical step - the actual removal. Must have been accidentally removed during a refactor. Fixes #3556 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Diffstat (limited to 'libpod')
-rw-r--r--libpod/runtime_ctr.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/libpod/runtime_ctr.go b/libpod/runtime_ctr.go
index 760a07daf..4b3aeaa37 100644
--- a/libpod/runtime_ctr.go
+++ b/libpod/runtime_ctr.go
@@ -431,10 +431,12 @@ 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 cleanupErr == nil {
- cleanupErr = err
- } else {
- logrus.Errorf("removing container from pod: %v", err)
+ if err := r.state.RemoveContainerFromPod(pod, c); err != nil {
+ if cleanupErr == nil {
+ cleanupErr = err
+ } else {
+ logrus.Errorf("removing container from pod: %v", err)
+ }
}
}
} else {