podman-py icon indicating copy to clipboard operation
podman-py copied to clipboard

Pulling a wrong image doesn't raise any error.

Open Alex-Izquierdo opened this issue 1 year ago • 2 comments

Library version: 4.5.1 Podman version: 3.4.7 and 4.5.1

How to reproduce:

In [25]: from podman import PodmanClient

In [26]: client = PodmanClient(base_url="unix:///run/user/1000/podman/podman.sock")

In [27]: image = client.images.pull("docker.io/library/python:3.11")

In [28]: image.id
Out[28]: 'c0e63845ae986c52da5cd6ac4d56eebf293439bb22a3cee198dd818fd12ba555'

In [29]: image = client.images.pull("wat/ough")

In [30]: image.id

In [31]: image = client.images.pull("docker.io/library/python:3.1415")

In [32]: image.id

In [33]: 

Expected result: It should raise APIError or ImageNotFound

Alex-Izquierdo avatar Jul 06 '23 08:07 Alex-Izquierdo

Thats true the pull function uses raise_for_status to catch a 404 not found but the podman api actually returns a 200 with

200
{"stream":"Trying to pull docker.io/libarasd/lego:latest...\n"}
{"error":"initializing source docker://libarasd/lego:latest: reading manifest latest in docker.io/libarasd/lego: requested access to the resource is denied"}

luebke-dev avatar Mar 20 '24 23:03 luebke-dev

https://github.com/containers/podman/issues/22105

luebke-dev avatar Mar 20 '24 23:03 luebke-dev