Skip to content

Commit

Permalink
Merge pull request #7155 from mheon/fix_rmi_force
Browse files Browse the repository at this point in the history
Ensure that 'rmi --force' evicts Podman containers
  • Loading branch information
openshift-merge-robot authored Jul 30, 2020
2 parents 05b3e0e + 9f5a11c commit ca2bda6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libpod/runtime_img.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (r *Runtime) RemoveImage(ctx context.Context, img *image.Image, force bool)
imageCtrs = append(imageCtrs, ctr)
}
}
if len(imageCtrs) > 0 && len(img.Names()) <= 1 {
if len(imageCtrs) > 0 && (len(img.Names()) <= 1 || (force && img.InputIsID())) {
if force {
for _, ctr := range imageCtrs {
if err := r.removeContainer(ctx, ctr, true, false, false); err != nil {
Expand Down

0 comments on commit ca2bda6

Please sign in to comment.