summaryrefslogtreecommitdiff
path: root/pkg/api/handlers
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-25 00:01:41 -0500
committerGitHub <noreply@github.com>2022-01-25 00:01:41 -0500
commit95db13d3428f901ed4c6b15e8187636a1ea01b12 (patch)
treea521a9d7956b2da4ace6302b01c8e19adc4e5f19 /pkg/api/handlers
parent6d8507d06bd8f1dbe91a688393e6fbd2b3382f23 (diff)
parent80a5295d42ad875259c5fd082ee781b9e08b2c8c (diff)
downloadpodman-95db13d3428f901ed4c6b15e8187636a1ea01b12.tar.gz
podman-95db13d3428f901ed4c6b15e8187636a1ea01b12.tar.bz2
podman-95db13d3428f901ed4c6b15e8187636a1ea01b12.zip
Merge pull request #12969 from rhatdan/remote
Fix handling of duplicate matches on id expansion
Diffstat (limited to 'pkg/api/handlers')
-rw-r--r--pkg/api/handlers/utils/errors.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkg/api/handlers/utils/errors.go b/pkg/api/handlers/utils/errors.go
index 919a8df1e..bf60b2c84 100644
--- a/pkg/api/handlers/utils/errors.go
+++ b/pkg/api/handlers/utils/errors.go
@@ -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) {