Skip to content

Podman pods.list() returns truncated IDs that can not be used by pods.get() #153

@rhatdan

Description

@rhatdan
$ podman create pod --name mypod
$ cat podman-pods.py
import podman
client=podman.PodmanClient()
for i in client.pods.list():
    print(i)
    print(help(client.pods.get(pod_id=i)))
$ python podman-images.py
<Pod: 116291543d>
Traceback (most recent call last):
  File "/home/dwalsh/go/src/github.com/containers/common/podman-images.py", line 5, in <module>
    print(help(client.pods.get(pod_id=i)))
  File "/usr/lib/python3.10/site-packages/podman/domain/pods_manager.py", line 56, in get
    response.raise_for_status()
  File "/usr/lib/python3.10/site-packages/podman/api/client.py", line 64, in raise_for_status
    raise not_found(cause, response=self._response, explanation=message)
podman.errors.exceptions.NotFound: 404 Client Error: Not Found (no pod with name or ID <Pod: 116291543d> found: no such pod)

I think there might be two bugs here.

  1. List, should not truncate the IDs returned.
  2. Podman pod.get() should be able to handle truncated IDs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions