gabrieldemarmiesse / python-on-whales

An awesome Python wrapper for an awesome Docker CLI!
MIT License
541 stars 101 forks source link

`DockerClient.image.exists` using `podman` does not work #557

Closed jhc4318 closed 6 months ago

jhc4318 commented 6 months ago

image.exists just calls image.inspect under the covers and parses the error output for no such image to determine if the image exists or not. https://github.com/gabrieldemarmiesse/python-on-whales/blob/4433a0227b90974f9e0c7090383deacedf8d01c6/python_on_whales/utils.py#L156

This works with docker

>docker image inspect hello
[]
Error response from daemon: No such image: hello:latest

But not for podman

>podman image inspect hello
[]
Error: inspecting object: hello: image not known

I think this should check for image not known as well.