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

/containers REST API output missing information #9529

Closed
linggao opened this issue Feb 26, 2021 · 2 comments · Fixed by #9581
Closed

/containers REST API output missing information #9529

linggao opened this issue Feb 26, 2021 · 2 comments · Fixed by #9581
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

@linggao
Copy link

linggao commented Feb 26, 2021

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

/kind bug

Description
There are several important fields like NetworkSettings, Mounts, Ports etc. having no information from the /containers REST API ouutput

Steps to reproduce the issue:

  1. podman network create foo-a

  2. podman run --name test --network foo-a -l a=b -v myvolume:/tmp/data -p 8080:80/udp -d alpine sleep 1000

  3. curl -gG -sSLw "%{http_code}" --unix-socket /var/run/podman/podman.sock http://localhost/containers/json?all=true --data-urlencode 'filters={"name":["test"]}' | jq

Describe the results you received:

[
  {
    "Id": "9024c6839730c775cbedaf72da773da884e52a378c9bfc62f71c96ddde5cec7f",
    "Names": [
      "/test"
    ],
    "Image": "docker.io/library/alpine:latest",
    "ImageID": "28f6e27057430ed2a40dbdd50d2736a3f0a295924016e294938110eeb8439818",
    "Command": "sleep 1000",
    "Created": 1614356009,
    "Ports": null,
    "Labels": {
      "a": "b"
    },
    "State": "running",
    "Status": "Up 5 minutes",
    "NetworkSettings": null,
    "Mounts": null,
    "Name": "",
    "Config": null,
    "NetworkingConfig": null,
    "Platform": null,
    "AdjustCPUShares": false
  }
]

Describe the results you expected:
The following is from docker REST API call.

[
  {
    "Id": "508efc749a185543e28fbc2266ae88a3cf20cf61d4cd1c69f4e24d3d67a4c290",
    "Names": [
      "/test"
    ],
    "Image": "alpine",
    "ImageID": "sha256:a24bb4013296f61e89ba57005a7b3e52274d8edd3ae2077d04395f806b63d83e",
    "Command": "sleep 1000",
    "Created": 1614356035,
    "Ports": [
      {
        "IP": "0.0.0.0",
        "PrivatePort": 80,
        "PublicPort": 8080,
        "Type": "udp"
      }
    ],
    "Labels": {
      "a": "b"
    },
    "State": "running",
    "Status": "Up 9 seconds",
    "HostConfig": {
      "NetworkMode": "foo-a"
    },
    "NetworkSettings": {
      "Networks": {
        "foo-a": {
          "IPAMConfig": null,
          "Links": null,
          "Aliases": null,
          "NetworkID": "57e0f0d53a7862bb79cc1b3c81fef66672df059e38e763395faa79a33568447f",
          "EndpointID": "20596bf9c86674be6a54f21f3820c3f8a60451f7ebf4642139e6efc8740e5dbc",
          "Gateway": "192.168.16.1",
          "IPAddress": "192.168.16.2",
          "IPPrefixLen": 20,
          "IPv6Gateway": "",
          "GlobalIPv6Address": "",
          "GlobalIPv6PrefixLen": 0,
          "MacAddress": "02:42:c0:a8:10:02",
          "DriverOpts": null
        }
      }
    },
    "Mounts": [
      {
        "Type": "volume",
        "Name": "myvolume",
        "Source": "/var/lib/docker/volumes/myvolume/_data",
        "Destination": "/tmp/data",
        "Driver": "local",
        "Mode": "z",
        "RW": true,
        "Propagation": ""
      }
    ]
  }
]

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

Output of podman version:

Version:      3.1.0-dev
API Version:  3.0.0
Go Version:   go1.14.12
Git Commit:   1702cbc6917f431bcc65d6c5bdc6fcf99231977a-dirty
Built:        Wed Feb 24 09:13:30 2021
OS/Arch:      linux/amd64

Output of podman info --debug:

host:
  arch: amd64
  buildahVersion: 1.19.6
  cgroupManager: systemd
  cgroupVersion: v1
  conmon:
    package: Unknown
    path: /usr/local/libexec/podman/conmon
    version: 'conmon version 2.0.27-dev, commit: 7310bf13319ee8ed50799b202509bedc27b36cf8'
  cpus: 2
  distribution:
    distribution: '"rhel"'
    version: "8.3"
  eventLogger: file
  hostname: lingvs4.dev.edge-fabric.com
  idMappings:
    gidmap: null
    uidmap: null
  kernel: 4.18.0-240.15.1.el8_3.x86_64
  linkmode: dynamic
  memFree: 3004583936
  memTotal: 8342470656
  ociRuntime:
    name: runc
    package: Unknown
    path: /usr/bin/runc
    version: |-
      runc version 1.0.0-rc93+dev
      commit: f245a1d1edbf545549e5a16106cf1aec356a3c7d
      spec: 1.0.2-dev
      go: go1.14.12
      libseccomp: 2.4.3
  os: linux
  remoteSocket:
    exists: true
    path: /run/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_AUDIT_WRITE,CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_MKNOD,CAP_NET_BIND_SERVICE,CAP_NET_RAW,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: false
    seccompEnabled: true
    selinuxEnabled: true
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 2146758656
  swapTotal: 2146758656
  uptime: 193h 13m 41.94s (Approximately 8.04 days)
registries:
  search:
  - registry.access.redhat.com
  - registry.redhat.io
  - docker.io
store:
  configFile: /etc/containers/storage.conf
  containerStore:
    number: 4
    paused: 0
    running: 4
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev,metacopy=on
  graphRoot: /var/lib/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "true"
  imageStore:
    number: 9
  runRoot: /var/run/containers/storage
  volumePath: /var/lib/containers/storage/volumes
version:
  APIVersion: 3.0.0
  Built: 1614179610
  BuiltTime: Wed Feb 24 09:13:30 2021
  GitCommit: 1702cbc6917f431bcc65d6c5bdc6fcf99231977a-dirty
  GoVersion: go1.14.12
  OsArch: linux/amd64
  Version: 3.1.0-dev

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

podman is built locally with latest code.

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide?

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

@linggao
Copy link
Author

linggao commented Mar 2, 2021

@baude Hi Brent, thanks for fixing this issue. Could you let me know where the PR is?

@linggao
Copy link
Author

linggao commented Mar 2, 2021

@baude thanks for the fix. I works for us.

baude added a commit to baude/podman that referenced this issue Mar 3, 2021
The compatibility endpoint for listing containers should have the
summarized network configuration with it.

Fixes: containers#9529

Signed-off-by: baude <bbaude@redhat.com>
@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.

2 participants