mirror of
https://github.com/containers/podman.git
synced 2025-06-23 02:18:13 +08:00
Merge pull request #14228 from rhatdan/api
Deleting an n use image should return conflict not system error
This commit is contained in:
@ -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
|
||||
}
|
||||
|
@ -156,6 +156,17 @@ t GET images/json?filters='{"reference":["test1"]}' 200 length=1
|
||||
|
||||
t DELETE libpod/images/test1:latest 200
|
||||
|
||||
# to be used in prune until filter tests
|
||||
podman image build -t docker.io/library/test1:latest -<<EOF
|
||||
from alpine
|
||||
RUN >file4
|
||||
EOF
|
||||
podman create --name test1 test1 echo hi
|
||||
|
||||
t DELETE images/test1:latest 409
|
||||
podman rm test1
|
||||
t DELETE images/test1:latest 200
|
||||
|
||||
t GET "images/get?names=alpine" 200 '[POSIX tar archive]'
|
||||
|
||||
podman pull busybox
|
||||
|
Reference in New Issue
Block a user