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 endpoint returns null instead of [] when there're no networks #9293

Closed
riyad opened this issue Feb 9, 2021 · 2 comments · Fixed by #9295
Closed

[APIv2] /networks endpoint returns null instead of [] when there're no networks #9293

riyad opened this issue Feb 9, 2021 · 2 comments · Fixed by #9295
Assignees
Labels
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. 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 9, 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 a flaky assertion in the TestNetworks::test_remove_network test.

It seems that Podman 3.0.0-dev wrongly returns null (instead of []) from the /networks endpoint when no networks are defined.

Steps to reproduce the issue:

  1. make sure we have no networks
NAME    VERSION  PLUGINS
  1. list the networks via API:
*   Trying /var/run/user/1000/podman/podman.sock:0...
* Connected to localhost (/run/user/1000/podman/podman.sock) port 80 (#0)
> GET /v1.40/networks HTTP/1.1
> Host: localhost
> User-Agent: curl/7.68.0
> Accept: */*
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Api-Version: 1.40
< Content-Type: application/json
< Libpod-Api-Version: 2.0.0
< Server: Libpod/2.0.0 (linux)
< Date: Tue, 09 Feb 2021 20:30:40 GMT
< Content-Length: 5
< 
null
* Connection #0 to host localhost left intact

Describe the results you received:

Response was 200 null

Describe the results you expected:

Response was 200 []

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

FWIW: Podman 2.2.1 returns the correct result.

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 9, 2021
@rhatdan
Copy link
Member

rhatdan commented Feb 9, 2021

@jwhonce @baude @Luap99 PTAL

@Luap99 Luap99 assigned Luap99 and unassigned jwhonce and baude Feb 9, 2021
@Luap99 Luap99 added the In Progress This issue is actively being worked by the assignee, please do not work on this at this time. label Feb 9, 2021
@Luap99
Copy link
Member

Luap99 commented Feb 9, 2021

I take this one.

Luap99 pushed a commit to Luap99/libpod that referenced this issue Feb 9, 2021
The networks list compat api endpoint must return `[]`
and not `null` if no networks are found.

Fixes containers#9293

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
@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
In Progress This issue is actively being worked by the assignee, please do not work on this at this time. 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.

6 participants