mirror of
https://github.com/containers/podman.git
synced 2025-10-16 18:53:19 +08:00
libpod API: return proper error status code for pod start
When we failed to do anything we should return 500, the 409 code has a special meaing to the client as it uses a different error format. As such the remote client was not able to unmarshal the error correctly and just returned an empty string. Fixes #22989 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -202,7 +202,7 @@ func PodStart(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
status, err := pod.GetPodStatus()
|
||||
if err != nil {
|
||||
utils.Error(w, http.StatusInternalServerError, err)
|
||||
utils.InternalServerError(w, err)
|
||||
return
|
||||
}
|
||||
if status == define.PodStateRunning {
|
||||
@ -212,13 +212,13 @@ func PodStart(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
responses, err := pod.Start(r.Context())
|
||||
if err != nil && !errors.Is(err, define.ErrPodPartialFail) {
|
||||
utils.Error(w, http.StatusConflict, err)
|
||||
utils.InternalServerError(w, err)
|
||||
return
|
||||
}
|
||||
|
||||
cfg, err := pod.Config()
|
||||
if err != nil {
|
||||
utils.Error(w, http.StatusConflict, err)
|
||||
utils.InternalServerError(w, err)
|
||||
return
|
||||
}
|
||||
report := entities.PodStartReport{
|
||||
|
Reference in New Issue
Block a user