summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/containers.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-03-10 14:04:51 +0100
committerGitHub <noreply@github.com>2021-03-10 14:04:51 +0100
commit786757fb01208cf72e1c67611acbab1411746036 (patch)
treebf5913f1abfc434f5dc3a2fb7684c7dc416aa296 /pkg/api/handlers/compat/containers.go
parent5331096b3882cd5c8e587200560e44ef1eb990a3 (diff)
parentf1eb8e816257d9dc810cfa6957e09db1ffa7db96 (diff)
downloadpodman-786757fb01208cf72e1c67611acbab1411746036.tar.gz
podman-786757fb01208cf72e1c67611acbab1411746036.tar.bz2
podman-786757fb01208cf72e1c67611acbab1411746036.zip
Merge pull request #9681 from rhatdan/rm
Removing a non existing container API should return 404
Diffstat (limited to 'pkg/api/handlers/compat/containers.go')
-rw-r--r--pkg/api/handlers/compat/containers.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go
index d26bb50f4..d3277b815 100644
--- a/pkg/api/handlers/compat/containers.go
+++ b/pkg/api/handlers/compat/containers.go
@@ -76,7 +76,12 @@ func RemoveContainer(w http.ResponseWriter, r *http.Request) {
return
}
if len(report) > 0 && report[0].Err != nil {
- utils.InternalServerError(w, report[0].Err)
+ err = report[0].Err
+ if errors.Cause(err) == define.ErrNoSuchCtr {
+ utils.ContainerNotFound(w, name, err)
+ return
+ }
+ utils.InternalServerError(w, err)
return
}