summaryrefslogtreecommitdiff
path: root/pkg/domain
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2021-02-21 05:25:40 -0500
committerDaniel J Walsh <dwalsh@redhat.com>2021-03-08 13:55:45 -0500
commite9db60492261df38cbef04a03c2693547b7e107d (patch)
tree419f6f554ff5033eb3707d266d073d2d2a81b156 /pkg/domain
parentb386d23bf01a1f3b0a604468803189625ef7b902 (diff)
downloadpodman-e9db60492261df38cbef04a03c2693547b7e107d.tar.gz
podman-e9db60492261df38cbef04a03c2693547b7e107d.tar.bz2
podman-e9db60492261df38cbef04a03c2693547b7e107d.zip
allow the removal of storage images
Sometimes if the system crashes while an image is being pulled containers/storage can get into a bad state. This PR allows the user to call into container storage to remove the image. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/domain')
-rw-r--r--pkg/domain/infra/abi/images.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index b1751b8b6..c02eb2bfc 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -640,6 +640,10 @@ func (ir *ImageEngine) Remove(ctx context.Context, images []string, opts entitie
for _, id := range images {
img, err := ir.Libpod.ImageRuntime().NewFromLocal(id)
if err != nil {
+ // attempt to remove image from storage
+ if forceErr := ir.Libpod.RemoveImageFromStorage(id); forceErr == nil {
+ continue
+ }
rmErrors = append(rmErrors, err)
continue
}