containers/podman

Inconsistency In Reported Pod and Container States

Open

#19.097 aberto em 3 de jul. de 2023

Ver no GitHub
 (10 comments) (0 reactions) (0 assignees)Go (3.107 forks)batch import
ContribfestGood First Issuekind/bugvolunteers-wanted

Métricas do repositório

Stars
 (31.686 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

Issue Description

The return value .State for pods and .State.Status for containers is inconsistent across pods and containers.

Pods show "Running" and containers reports "running", noting the case difference.

My searching has not brought any results as to why this may have been done this way.

I am performing some manual health checks and while its probably not the best way to do this, does seem like an odd inconsistency. This is not ruining in a Kube env but in single host env.

Steps to reproduce the issue

Steps to reproduce the issue

  1. Start up, run a pod and a single container
  2. Perform a podman inspect <container> --format "{{.State.Status}}"
  3. Perfrom a podman inspect <pod> -type pod --format "{{.State}}"

You can also perform a manual inspect.

Describe the results you received

[ ~]$ podman inspect <container> --format "{{.State.Status}}" && podman inspect <pod> --type pod --format "{{.State}}"
running
Running

Describe the results you expected

[ ~]$ podman inspect <container> --format "{{.State.Status}}" && podman inspect <pod> --type pod --format "{{.State}}"
running
running

or "Running" but lowercase seems more consistent with all other values that are retruend

podman info output

`host:
  arch: amd64
  buildahVersion: 1.29.0
  cgroupControllers: []
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.6-1.module+el8.8.0+18098+9b44df5f.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.6, commit: 8c4ab5a095127ecc96ef8a9c885e0e1b14aeb11b'
  cpuUtilization:
    idlePercent: 99.26
    systemPercent: 0.52
    userPercent: 0.21
  cpus: 4
  distribution:
    distribution: '"rhel"'
    version: "8.8"
  eventLogger: file
hostname: <hostname>
  idMappings:
    gidmap:
    - container_id: 0
      host_id: <userspace>
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
    uidmap:
    - container_id: 0
      host_id: <userspace>
      size: 1
    - container_id: 1
      host_id: 100000
      size: 65536
  kernel: 4.18.0-477.13.1.el8_8.x86_64
  linkmode: dynamic
  logDriver: k8s-file
  memFree: 1497952256
  memTotal: 8070406144
  networkBackend: cni
  ociRuntime:
    name: runc
    package: runc-1.1.4-1.module+el8.8.0+18060+3f21f2cc.x86_64
    path: /usr/bin/runc
    version: |-
      runc version 1.1.4
      spec: 1.0.2-dev
      go: go1.19.4
      libseccomp: 2.5.2
  os: linux
  remoteSocket:
    exists: true
    path: <rootless_userspace>
  security:
    apparmorEnabled: false
    capabilities: CAP_SYS_CHROOT,CAP_NET_RAW,CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /bin/slirp4netns
    package: slirp4netns-1.2.0-2.module+el8.8.0+18060+3f21f2cc.x86_64
    version: |-
      slirp4netns version 1.2.0
      commit: 656041d45cfca7a4176f6b7eed9e4fe6c11e8383
      libslirp: 4.4.0
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.2
  swapFree: 3213246464
  swapTotal: 3267358720
  uptime: 241h 2m 43.00s (Approximately 10.04 days)
plugins:
authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.access.redhat.com
  - registry.redhat.io
  - docker.io
store:
  configFile: /home/<hostname>/.config/containers/storage.conf
  containerStore:
    number: 5
    paused: 0
    running: 4
    stopped: 1
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/<hostname>/.local/share/containers/storage
  graphRootAllocated: 16489906176
  graphRootUsed: 2804224000
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 8
  runRoot: <rootless_userspace>
  transientStore: false
  volumePath: /home/<hostname>/.local/share/containers/storage/volumes
version:
  APIVersion: 4.4.1
  Built: 1682529191
  BuiltTime: Wed Apr 26 13:13:11 2023
  GitCommit: ""
  GoVersion: go1.19.6
  Os: linux
  OsArch: linux/amd64
  Version: 4.4.1`

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

No

Additional environment details

Additional environment details

Additional information

Additional information like issue happens only occasionally or issue happens with a particular architecture or on a particular setting

Guia do colaborador