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

API remove network returns array instead of a single result #10494

Closed
arctic-alpaca opened this issue May 28, 2021 · 3 comments · Fixed by #10563
Closed

API remove network returns array instead of a single result #10494

arctic-alpaca opened this issue May 28, 2021 · 3 comments · Fixed by #10563
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

@arctic-alpaca
Copy link
Contributor

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

/kind bug

Description

The API reference lists a single element as reponse to a request to the remove network endpoint. The API returns an array instead.

Steps to reproduce the issue:

  1. podman system service unix:///home/`whoami`/testing.sock --log-level=debug --time=500

  2. podman network create testing

  3. curl -X DELETE --unix-socket /home/`whoami`/testing.sock http://d/v3.2.0/libpod/networks/testing
    [{"Name":"testing","Err":null}]
    

Describe the results you received:
An array of results.

Describe the results you expected:
A single result.

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

Output of podman version:

Version:      3.2.0-dev
API Version:  3.2.0-dev
Go Version:   go1.15.10
Git Commit:   6ff56ab50a10e2350013c4ff1bf4b8d5d7b5aa87-dirty
Built:        Tue Jan  1 01:00:00 1980
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.20.1-dev
  cgroupManager: cgroupfs
  cgroupVersion: v1
  conmon:
    package: 'conmon: /usr/libexec/podman/conmon'
    path: /usr/libexec/podman/conmon
    version: 'conmon version 2.0.27, commit: '
  cpus: 12
  distribution:
    distribution: debian
    version: "10"
  eventLogger: file
  hostname: DESKTOP
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 5.4.72-microsoft-standard-WSL2
  linkmode: static
  memFree: 12503470080
  memTotal: 13346447360
  ociRuntime:
    name: crun
    package: 'crun: /usr/bin/crun'
    path: /usr/bin/crun
    version: |-
      crun version 0.18.1-7931a-dirty
      commit: 7931a1eab0590eff4041c1f74e2844b297c31cea
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /tmp/podman-run-1000/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    selinuxEnabled: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: 'slirp4netns: /usr/bin/slirp4netns'
    version: |-
      slirp4netns version 1.1.8
      commit: unknown
      libslirp: 4.3.1-git
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.4.4
  swapFree: 4294967296
  swapTotal: 4294967296
  uptime: 51m 52.44s
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /home/alpaca/.config/containers/storage.conf
  containerStore:
    number: 4
    paused: 0
    running: 0
    stopped: 4
  graphDriverName: overlay
  graphOptions:
    overlay.mount_program:
      Executable: /usr/bin/fuse-overlayfs
      Package: 'fuse-overlayfs: /usr/bin/fuse-overlayfs'
      Version: |-
        fusermount3 version: 3.4.1
        fuse-overlayfs: version 1.4
        FUSE library version 3.4.1
        using FUSE kernel interface version 7.27
  graphRoot: /home/alpaca/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 15
  runRoot: /tmp/podman-run-1000/containers
  volumePath: /home/alpaca/.local/share/containers/storage/volumes
version:
  APIVersion: 3.2.0-dev
  Built: 315532800
  BuiltTime: Tue Jan  1 01:00:00 1980
  GitCommit: 6ff56ab50a10e2350013c4ff1bf4b8d5d7b5aa87-dirty
  GoVersion: go1.15.10
  OsArch: linux/amd64
  Version: 3.2.0-dev

Package info (e.g. output of rpm -q podman or apt list podman):

Static build from here.

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

Checked troubleshooting guide, didn't find any static builds from CI besides the one from the 3.1.2 release I downloaded earlier.

Additional environment details (AWS, VirtualBox, physical, etc.):
Windows 10, 64bit, WLS2, Debian 10

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label May 28, 2021
@Luap99
Copy link
Member

Luap99 commented Jun 3, 2021

I agree that it doesn't make sense to return an array. However, I am not sure if we can change that now because this would be a breaking change to the API. @baude @jwhonce WDYT?

@rhatdan
Copy link
Member

rhatdan commented Jun 3, 2021

I don't think this is worth breaking the API.

@jwhonce
Copy link
Member

jwhonce commented Jun 3, 2021

@arctic-alpaca I agree it would make more sense to return a single instance as documented vs. an array "as built". But our contract with developers is to only make breaking changes to the API on major releases. The earliest we can make this change is Podman 4.x.

@Luap99 Please update the swagger comment in pkg/api/server/register_networks.go:211 to reflect that an array is returned. TIA

Luap99 added a commit to Luap99/libpod that referenced this issue Jun 4, 2021
The endpoint returns an array and not a single entry.

Fixes containers#10494

Signed-off-by: Paul Holzinger <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Jun 11, 2021
The endpoint returns an array and not a single entry.

Fixes containers#10494

Signed-off-by: Paul Holzinger <[email protected]>
@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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 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.

4 participants