Skip to content

Commit

Permalink
Fix a bug where ctrs could not be removed from pods
Browse files Browse the repository at this point in the history
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 containers#3556

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
  • Loading branch information
mheon committed Jul 11, 2019
1 parent df3f5af commit 8713483
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libpod/runtime_ctr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 8713483

Please sign in to comment.