Skip to content

Commit

Permalink
Fix handling of duplicate matches on id expansion
Browse files Browse the repository at this point in the history
Fixes: containers#12963

[NO NEW TESTS NEEDED] I don't know how to create two
containers with the same first digit of the digest,
which I could them attempt to remove.

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Jan 24, 2022
1 parent 54bfabb commit 80a5295
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/api/handlers/utils/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ func VolumeNotFound(w http.ResponseWriter, name string, err error) {
}

func ContainerNotFound(w http.ResponseWriter, name string, err error) {
if errors.Cause(err) != define.ErrNoSuchCtr {
switch errors.Cause(err) {
case define.ErrNoSuchCtr, define.ErrCtrExists:
Error(w, http.StatusNotFound, err)
default:
InternalServerError(w, err)
}
Error(w, http.StatusNotFound, err)
}

func ImageNotFound(w http.ResponseWriter, name string, err error) {
Expand Down

0 comments on commit 80a5295

Please sign in to comment.