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

[APIv2] /networks/prune endpoint has wrong response format #9310

Closed
riyad opened this issue Feb 10, 2021 · 1 comment · Fixed by #9312
Closed

[APIv2] /networks/prune endpoint has wrong response format #9310

riyad opened this issue Feb 10, 2021 · 1 comment · Fixed by #9312
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@riyad
Copy link
Contributor

riyad commented Feb 10, 2021

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Trying to find regressions by exercising the APIv2 trough docker-py's test suite (see #5386) I came across the failing TestNetworks::test_prune_networks test.

It seems that the Podman 3.0.0-dev /networks/prune endpoint wrongly returns the list of deleted networks directly [...] (instead of nesting them according to the Docker API docs).

Steps to reproduce the issue:

$ curl -sS --unix-socket /var/run/user/1000/podman/podman.sock -XPOST 'http://localhost/v1.40/networks/create' -H "Content-Type: application/json" -d '{"Name": "dockerpytest_6a208c32613d1dde"}'
{"Id":"f5e714d4689079d34aa0b0f1d8a11f930da56bb66e1a450f31727776b9029a1c","Warning":null}
$ curl -sS --unix-socket /var/run/user/1000/podman/podman.sock -XPOST 'http://localhost/v1.40/networks/prune'                                                                                   
["dockerpytest_6a208c32613d1dde"]

Describe the results you received:

The response looked like 200 ["<network name>", ...]

Describe the results you expected:

The response should look like 200 {"NetworksDeleted": ["<network name>", ...]}

Additional information you deem important (e.g. issue happens only occasionally):

Docker API docs: https://docs.docker.com/engine/api/v1.40/#operation/NetworkPrune

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 10, 2021
@baude baude self-assigned this Feb 10, 2021
baude added a commit to baude/podman that referenced this issue Feb 10, 2021
Correcting the structure of the compat network prune response.  They
should follow {"NetworksDeleted": [<network_name>",...]}

Fixes: containers#9310

Signed-off-by: baude <[email protected]>
@baude
Copy link
Member

baude commented Feb 10, 2021

thanks for the excellent write up!

@github-actions github-actions 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 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. 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 a pull request may close this issue.

3 participants