containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
23.27k stars 2.37k forks source link

Get Info API Method doesn't supply remoteSocket field #10077

Closed arctic-alpaca closed 3 years ago

arctic-alpaca commented 3 years ago

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

/kind bug

Description

The json response from the system -> get info API method doesn't contain the remoteSocket field.

Steps to reproduce the issue:

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

  2. Call info method curl --unix-socket /home/`whoami`/podman.sock http://d/v3.0.0/libpod/info

Describe the results you received:

{"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","memFree":12767571968,"memTotal":13348544512,"ociRuntime":{"name":"crun","package":"crun: /usr/bin/crun","path":"/usr/bin/crun","version":"crun version 0.18.1-7931a-dirty\ncommit: 7931a1eab0590eff4041c1f74e2844b297c31cea\nspec: 1.0.0\n+SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL"},"os":"linux","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\ncommit: unknown\nlibslirp: 4.3.1-git\nSLIRP_CONFIG_VERSION_MAX: 3\nlibseccomp: 2.4.4"},"swapFree":4294967296,"swapTotal":4294967296,"uptime":"3h 23m 38.29s (Approximately 0.12 days)","linkmode":"static"},"store":{"configFile":"/home/xyz/.config/containers/storage.conf","containerStore":{"number":7,"paused":0,"running":0,"stopped":7},"graphDriverName":"overlay","graphOptions":{"overlay.mount_program":{"Executable":"/usr/bin/fuse-overlayfs","Package":"fuse-overlayfs: /usr/bin/fuse-overlayfs","Version":"fusermount3 version: 3.4.1\nfuse-overlayfs: version 1.4\nFUSE library version 3.4.1\nusing FUSE kernel interface version 7.27"}},"graphRoot":"/home/xyz/.local/share/containers/storage","graphStatus":{"Backing Filesystem":"extfs","Native Overlay Diff":"false","Supports d_type":"true","Using metacopy":"false"},"imageStore":{"number":2},"runRoot":"/tmp/podman-run-1000/containers","volumePath":"/home/xyz/.local/share/containers/storage/volumes"},"registries":{"search":["docker.io","quay.io"]},"version":{"APIVersion":"3.2.0-dev","Version":"3.2.0-dev","GoVersion":"go1.15.10","GitCommit":"6ff56ab50a10e2350013c4ff1bf4b8d5d7b5aa87-dirty","BuiltTime":"Tue Jan  1 01:00:00 1980","Built":315532800,"OsArch":"linux/amd64"}}

Describe the results you expected:

The same as above, just with a remoteSocket field.

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: 12781981696
  memTotal: 13348544512
  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: 3h 41m 34.73s (Approximately 0.12 days)
registries:
  search:
  - docker.io
  - quay.io
store:
  configFile: /home/xyz/.config/containers/storage.conf
  containerStore:
    number: 7
    paused: 0
    running: 0
    stopped: 7
  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/xyz/.local/share/containers/storage
  graphStatus:
    Backing Filesystem: extfs
    Native Overlay Diff: "false"
    Supports d_type: "true"
    Using metacopy: "false"
  imageStore:
    number: 2
  runRoot: /tmp/podman-run-1000/containers
  volumePath: /home/xyz/.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):

podman/unknown,now 100:3.0.1-2 amd64 [installed]

Note, I discovered this issue on version 3.0.1 and could replicate it with the static build from this ci run.

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.):

Windows 10, WSL2, Debian, x64

zhangguanzhang commented 3 years ago

same with podman-remote. I looked at the code, but I don’t know how to modify it with minimal intervention @rhatdan PTAL

arctic-alpaca commented 3 years ago

I just noticed another thing, when using podman info --format="json", the response is missing the exists field in the remoteSocket object.

zhangguanzhang commented 3 years ago

I just noticed another thing, when using podman info --format="json", the response is missing the exists field in the remoteSocket object.

[root@Centos8 ~/podman]# podman info --format 'json' | jq .host.remoteSocket
{
  "path": "/run/podman/podman.sock",
  "exists": true
}
[root@Centos8 ~/podman]# podman version
Version:      3.0.1
API Version:  3.0.0
Go Version:   go1.14.12
Built:        Fri Apr  9 23:07:44 2021
OS/Arch:      linux/amd64
arctic-alpaca commented 3 years ago

this is not a bug. only display when the sock file is exists

Is this intended? Shouldn't it be

{
  "path": "/run/podman/podman.sock",
  "exists": false
}

if the file doesn't exist?

zhangguanzhang commented 3 years ago

this is not a bug. only display when the sock file is exists

Is this intended? Shouldn't it be

{
  "path": "/run/podman/podman.sock",
  "exists": false
}

if the file doesn't exist?

yes