-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
docker rest api compatibility not honored for error responses. #20013
Comments
Do you have an example of the Docker response? Interested in opening a PR to fix this issue? |
Hi @rhatdan thanks for your quick response.
It would be my first attempt to contribute to the Podman code, but I'm happy to give it a try. What would be the best approach to fix it? Should we move the "message" field up one level, duplicate it, or rename the current |
I would move the message field up one level, or just return the message field instead of the entire report message. |
Hi, after reading this issue I found where the message was created I changed the message to return the error response in the way that Alex commented |
This is related to the issue containers#20013 Signed-off-by: Gabriel Pozo <[email protected]>
A friendly reminder that this issue had no activity for 30 days. |
@jackgris could you open a PR to fix this issue? |
Actually after looking at the code it looks like @jackgris fix is in Podman, so I am going to assume this is fixed. Reopen if I am mistaken. |
Yes, I forgot to add another comment here mentioning this: #20239 |
Issue Description
It seems that the compatibility with the api rest of docker is not met for error responses. According to the docker docs, the response should include a field "message" but podman has a different schema.
This can be reproduced easily running a request to pull an image, for example. As consequence, clients like the official python library for docker doesn't work because the response has a different schema (the message is inside "errordetail") and the library expects to have a "message" key at the root level as is described in the docs.
Docker docs ref: https://docs.docker.com/engine/api/v1.43/#tag/Image/operation/ImageCreate
Example of podman response
Tested with latest podman container 4.6.1
Steps to reproduce the issue
Describe the results you received
The response doesn't meet the spec of docker api response, don't have a "message" key in the root level
Describe the results you expected
a "message" key in the root level with the reason of the error.
podman info output
podman v4.6.1
Podman in a container
Yes
Privileged Or Rootless
Privileged
Upstream Latest Release
Yes
Additional environment details
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: