summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-02-11 15:26:37 -0500
committerGitHub <noreply@github.com>2021-02-11 15:26:37 -0500
commitddd8a1799dfc1621da39f672a47e9984ebec0e2f (patch)
treefe64cfa009b2ab10ab688ff334dab73d8e61a42b /pkg
parent2b89fe7d5dcf4e2e33127eaefdb02419c42592a6 (diff)
parente05e53cd2ceeb6df362e4b3764ea23c19b878ff0 (diff)
downloadpodman-ddd8a1799dfc1621da39f672a47e9984ebec0e2f.tar.gz
podman-ddd8a1799dfc1621da39f672a47e9984ebec0e2f.tar.bz2
podman-ddd8a1799dfc1621da39f672a47e9984ebec0e2f.zip
Merge pull request #9327 from mheon/30_final
Bump to v3.0 Final
Diffstat (limited to 'pkg')
-rw-r--r--pkg/domain/infra/abi/images.go17
1 files changed, 13 insertions, 4 deletions
diff --git a/pkg/domain/infra/abi/images.go b/pkg/domain/infra/abi/images.go
index 8ca93e770..f2d0f2c39 100644
--- a/pkg/domain/infra/abi/images.go
+++ b/pkg/domain/infra/abi/images.go
@@ -580,12 +580,21 @@ func (ir *ImageEngine) Remove(ctx context.Context, images []string, opts entitie
// without having to pass all local data around.
deleteImage := func(img *image.Image) error {
results, err := ir.Libpod.RemoveImage(ctx, img, opts.Force)
- if err != nil {
+ switch errors.Cause(err) {
+ case nil:
+ // Removal worked, so let's report it.
+ report.Deleted = append(report.Deleted, results.Deleted)
+ report.Untagged = append(report.Untagged, results.Untagged...)
+ return nil
+ case storage.ErrImageUnknown:
+ // The image must have been removed already (see #6510).
+ report.Deleted = append(report.Deleted, img.ID())
+ report.Untagged = append(report.Untagged, img.ID())
+ return nil
+ default:
+ // Fatal error.
return err
}
- report.Deleted = append(report.Deleted, results.Deleted)
- report.Untagged = append(report.Untagged, results.Untagged...)
- return nil
}
// Delete all images from the local storage.