containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
22.36k stars 2.31k forks source link

libpod API: fix two pod remote error messages #23080

Closed Luap99 closed 6 days ago

Luap99 commented 6 days ago

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 https://github.com/containers/podman/issues/22989


remote API: fix pod top error reporting

Do not return 200 status code before we know if there will be an error. Delay writing the status code until we send the first response. That way we can set an error code inside the loop when we get a error on the first try, i.e. because an invalid descriptor was used.

Fixes https://github.com/containers/podman/issues/22986

Does this PR introduce a user-facing change?

Fixed an incorrect error status code in the libpod pod start REST API.
Fixed a missing error message when using the libpod pod top REST API.
packit-as-a-service[bot] commented 6 days ago

Ephemeral COPR build failed. @containers/packit-build please check.

openshift-ci[bot] commented 6 days ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, Luap99

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/containers/podman/blob/main/OWNERS)~~ [Luap99,giuseppe] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
rhatdan commented 6 days ago

/lgtm