diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-01-25 00:01:41 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-25 00:01:41 -0500 |
commit | 95db13d3428f901ed4c6b15e8187636a1ea01b12 (patch) | |
tree | a521a9d7956b2da4ace6302b01c8e19adc4e5f19 | |
parent | 6d8507d06bd8f1dbe91a688393e6fbd2b3382f23 (diff) | |
parent | 80a5295d42ad875259c5fd082ee781b9e08b2c8c (diff) | |
download | podman-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
-rw-r--r-- | pkg/api/handlers/utils/errors.go | 6 |
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) { |