summaryrefslogtreecommitdiff
path: root/libpod/runtime_img.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-07-30 14:52:59 -0400
committerGitHub <noreply@github.com>2020-07-30 14:52:59 -0400
commitca2bda64206134a4b1bec5f8934bf6a3c46cfbfd (patch)
tree94554f70bd5c4d6ffe2e8c84ab0bc10ee85eed62 /libpod/runtime_img.go
parent05b3e0e16bbbfede19bc5d817c62598e1ac6fa70 (diff)
parent9f5a11cacc47464e7fed44444b59104373abb5b0 (diff)
downloadpodman-ca2bda64206134a4b1bec5f8934bf6a3c46cfbfd.tar.gz
podman-ca2bda64206134a4b1bec5f8934bf6a3c46cfbfd.tar.bz2
podman-ca2bda64206134a4b1bec5f8934bf6a3c46cfbfd.zip
Merge pull request #7155 from mheon/fix_rmi_force
Ensure that 'rmi --force' evicts Podman containers
Diffstat (limited to 'libpod/runtime_img.go')
-rw-r--r--libpod/runtime_img.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/runtime_img.go b/libpod/runtime_img.go
index 72cd26a4e..4b5129f44 100644
--- a/libpod/runtime_img.go
+++ b/libpod/runtime_img.go
@@ -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 {