summaryrefslogtreecommitdiff
path: root/pkg/api
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-05-18 11:48:06 -0400
committerGitHub <noreply@github.com>2022-05-18 11:48:06 -0400
commit7093885df73989acd2aa2dd936695d0b30a3dcf8 (patch)
treedc2b3cf6c66ad92152df4121f9661755a03a4d19 /pkg/api
parent12964c7b93457a05441db081270a51083a1398f4 (diff)
parentee782fcb70c3d0d8f656406d346a3972f3200c83 (diff)
downloadpodman-7093885df73989acd2aa2dd936695d0b30a3dcf8.tar.gz
podman-7093885df73989acd2aa2dd936695d0b30a3dcf8.tar.bz2
podman-7093885df73989acd2aa2dd936695d0b30a3dcf8.zip
Merge pull request #14228 from rhatdan/api
Deleting an n use image should return conflict not system error
Diffstat (limited to 'pkg/api')
-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
}