Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libpod API: fix two pod remote error messages #23080

Merged
merged 2 commits into from
Jun 24, 2024

Conversation

Luap99
Copy link
Member

@Luap99 Luap99 commented Jun 24, 2024

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


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 #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.

Luap99 added 2 commits June 24, 2024 13:46
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 containers#22989

Signed-off-by: Paul Holzinger <[email protected]>
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 containers#22986

Signed-off-by: Paul Holzinger <[email protected]>
@github-actions github-actions bot added the kind/api-change Change to remote API; merits scrutiny label Jun 24, 2024
Copy link

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

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

openshift-ci bot commented Jun 24, 2024

[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:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2024
@rhatdan
Copy link
Member

rhatdan commented Jun 24, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit 80cf0e2 into containers:main Jun 24, 2024
89 of 90 checks passed
@Luap99 Luap99 deleted the remote-err branch June 24, 2024 13:51
@stale-locking-app stale-locking-app bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 23, 2024
@stale-locking-app stale-locking-app bot locked as resolved and limited conversation to collaborators Sep 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/api-change Change to remote API; merits scrutiny lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remote: pod start empty pod: error without message remote: pod top -eo invalid: unmarshalling error
3 participants