summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2022-05-12 17:00:44 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2022-05-16 09:59:19 -0400
commitee782fcb70c3d0d8f656406d346a3972f3200c83 (patch)
tree4040e9f884ba33a202dade103b42363a4a73f6e4 /pkg/api/handlers/compat
parentd8e8e628220b890986b11c9646ad593148dc5d3c (diff)
downloadpodman-ee782fcb70c3d0d8f656406d346a3972f3200c83.tar.gz
podman-ee782fcb70c3d0d8f656406d346a3972f3200c83.tar.bz2
podman-ee782fcb70c3d0d8f656406d346a3972f3200c83.zip
Deleting an n use image should return conflict not system error
Fixes: https://github.com/containers/podman/issues/14208 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'pkg/api/handlers/compat')
-rw-r--r--pkg/api/handlers/compat/images_remove.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/pkg/api/handlers/compat/images_remove.go b/pkg/api/handlers/compat/images_remove.go
index f45b38c66..35bcb36aa 100644
--- a/pkg/api/handlers/compat/images_remove.go
+++ b/pkg/api/handlers/compat/images_remove.go
@@ -52,7 +52,10 @@ func RemoveImage(w http.ResponseWriter, r *http.Request) {
utils.ImageNotFound(w, name, errors.Wrapf(err, "failed to find image %s", name))
return
}
-
+ if errors.Cause(err) == storage.ErrImageUsedByContainer {
+ utils.Error(w, http.StatusConflict, errors.Wrapf(err, "image %s is in use", name))
+ return
+ }
utils.Error(w, http.StatusInternalServerError, err)
return
}