Skip to content

Conversation

@tollsimy
Copy link

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 16, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tollsimy
Once this PR has been reviewed and has the lgtm label, please assign lsm5 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Signed-off-by: Simone Tollardo <simone.tollardo@redhat.com>
Copy link
Contributor

@inknos inknos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution @tollsimy , I think it's a good PR, but I'd consider using the same logic that podman cli uses for this call. see my comment at the code

but maybe you thought about it, so I would like to hear your opinion on the matter.

depending on this, tests will need to be adjusted accordingly :)

Comment on lines +381 to +392
if response.status_code == requests.codes.not_found:
self.podman_client.images.pull(
image,
auth_config=kwargs.get("auth_config"),
platform=kwargs.get("platform"),
policy=kwargs.get("policy", "missing"),
)
response = self.client.post(
"/containers/create",
headers={"content-type": "application/json"},
data=payload,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was curious to see what podman cli does when you call create, so I tried. when you do podman-remote create you get a pull call no matter if the image is cached or not

POST /v5.7.0/libpod/images/pull
POST /v5.7.0/libpod/containers/create

therefore I would simply remove the if and try to pull every time you create

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, but podman cli default pull policy should be "missing", thus, it should not pull if the image is cached:

tollsimy@thinkpad-redhat:~$ podman pull quay.io/fedora/fedora:43
Trying to pull quay.io/fedora/fedora:43...
Getting image source signatures
Copying blob 5f0ebf85c063 skipped: already exists  
Copying config ad291a240e done   | 
Writing manifest to image destination
ad291a240ef9da8feda7517b3757f4bb9b1af017df724110e96472f34fa5103b
tollsimy@thinkpad-redhat:~$ podman create --log-level=debug quay.io/fedora/fedora:43
INFO[0000] podman filtering at log level debug          
DEBU[0000] Called create.PersistentPreRunE(podman create --log-level=debug quay.io/fedora/fedora:43) 
INFO[0000] Setting parallel job count to 67             
DEBU[0000] Using conmon: "/usr/bin/conmon"              
INFO[0000] Using sqlite as database backend             
DEBU[0000] Using graph driver overlay                   
DEBU[0000] Using graph root /var/home/tollsimy/.local/share/containers/storage 
DEBU[0000] Using run root /run/user/1000/containers     
DEBU[0000] Using static dir /var/home/tollsimy/.local/share/containers/storage/libpod 
DEBU[0000] Using tmp dir /run/user/1000/libpod/tmp      
DEBU[0000] Using volume path /var/home/tollsimy/.local/share/containers/storage/volumes 
DEBU[0000] Using transient store: false                 
DEBU[0000] [graphdriver] trying provided driver "overlay" 
DEBU[0000] Cached value indicated that overlay is supported 
DEBU[0000] Cached value indicated that overlay is supported 
DEBU[0000] Cached value indicated that metacopy is not being used 
DEBU[0000] Cached value indicated that native-diff is usable 
DEBU[0000] backingFs=btrfs, projectQuotaSupported=false, useNativeDiff=true, usingMetacopy=false 
DEBU[0000] Initializing event backend journald          
DEBU[0000] Configured OCI runtime crun-vm initialization failed: no valid executable found for OCI runtime crun-vm: invalid argument 
DEBU[0000] Configured OCI runtime crun-wasm initialization failed: no valid executable found for OCI runtime crun-wasm: invalid argument 
DEBU[0000] Configured OCI runtime kata initialization failed: no valid executable found for OCI runtime kata: invalid argument 
DEBU[0000] Configured OCI runtime runsc initialization failed: no valid executable found for OCI runtime runsc: invalid argument 
DEBU[0000] Configured OCI runtime ocijail initialization failed: no valid executable found for OCI runtime ocijail: invalid argument 
DEBU[0000] Configured OCI runtime runc initialization failed: no valid executable found for OCI runtime runc: invalid argument 
DEBU[0000] Configured OCI runtime runj initialization failed: no valid executable found for OCI runtime runj: invalid argument 
DEBU[0000] Configured OCI runtime youki initialization failed: no valid executable found for OCI runtime youki: invalid argument 
DEBU[0000] Configured OCI runtime krun initialization failed: no valid executable found for OCI runtime krun: invalid argument 
DEBU[0000] Using OCI runtime "/usr/bin/crun"            
DEBU[0000] Pulling image quay.io/fedora/fedora:43 (policy: missing) 
DEBU[0000] Looking up image "quay.io/fedora/fedora:43" in local containers storage 
DEBU[0000] Normalized platform linux/amd64 to {amd64 linux  [] } 
DEBU[0000] Trying "quay.io/fedora/fedora:43" ...        
DEBU[0000] parsed reference into "[overlay@/var/home/tollsimy/.local/share/containers/storage+/run/user/1000/containers]@ad291a240ef9da8feda7517b3757f4bb9b1af017df724110e96472f34fa5103b" 
DEBU[0000] Found image "quay.io/fedora/fedora:43" as "quay.io/fedora/fedora:43" in local containers storage 
DEBU[0000] Found image "quay.io/fedora/fedora:43" as "quay.io/fedora/fedora:43" in local containers storage ([overlay@/var/home/tollsimy/.local/share/containers/storage+/run/user/1000/containers]@ad291a240ef9da8feda7517b3757f4bb9b1af017df724110e96472f34fa5103b) 
DEBU[0000] exporting opaque data as blob "sha256:ad291a240ef9da8feda7517b3757f4bb9b1af017df724110e96472f34fa5103b" 
DEBU[0000] Looking up image "quay.io/fedora/fedora:43" in local containers storage 
DEBU[0000] Normalized platform linux/amd64 to {amd64 linux  [] } 
DEBU[0000] Trying "quay.io/fedora/fedora:43" ...        
DEBU[0000] parsed reference into "[overlay@/var/home/tollsimy/.local/share/containers/storage+/run/user/1000/containers]@ad291a240ef9da8feda7517b3757f4bb9b1af017df724110e96472f34fa5103b" 
DEBU[0000] Found image "quay.io/fedora/fedora:43" as "quay.io/fedora/fedora:43" in local containers storage 
DEBU[0000] Found image "quay.io/fedora/fedora:43" as "quay.io/fedora/fedora:43" in local containers storage ([overlay@/var/home/tollsimy/.local/share/containers/storage+/run/user/1000/containers]@ad291a240ef9da8feda7517b3757f4bb9b1af017df724110e96472f34fa5103b) 
DEBU[0000] exporting opaque data as blob "sha256:ad291a240ef9da8feda7517b3757f4bb9b1af017df724110e96472f34fa5103b" 
DEBU[0000] Inspecting image ad291a240ef9da8feda7517b3757f4bb9b1af017df724110e96472f34fa5103b 
DEBU[0000] exporting opaque data as blob "sha256:ad291a240ef9da8feda7517b3757f4bb9b1af017df724110e96472f34fa5103b" 
DEBU[0000] Inspecting image ad291a240ef9da8feda7517b3757f4bb9b1af017df724110e96472f34fa5103b 
DEBU[0000] Inspecting image ad291a240ef9da8feda7517b3757f4bb9b1af017df724110e96472f34fa5103b 
DEBU[0000] using systemd mode: false                    
DEBU[0000] No hostname set; container's hostname will default to runtime default 
DEBU[0000] Loading seccomp profile from "/usr/share/containers/seccomp.json" 
DEBU[0000] Allocated lock 108 for container 12410d146b11430b5bfee809b0e435a237bd429808c916c30d808e9e89959f22 
DEBU[0000] exporting opaque data as blob "sha256:ad291a240ef9da8feda7517b3757f4bb9b1af017df724110e96472f34fa5103b" 
DEBU[0000] Cached value indicated that idmapped mounts for overlay are not supported 
DEBU[0000] Check for idmapped mounts support            
DEBU[0000] Created container "12410d146b11430b5bfee809b0e435a237bd429808c916c30d808e9e89959f22" 
DEBU[0000] Container "12410d146b11430b5bfee809b0e435a237bd429808c916c30d808e9e89959f22" has work directory "/var/home/tollsimy/.local/share/containers/storage/overlay-containers/12410d146b11430b5bfee809b0e435a237bd429808c916c30d808e9e89959f22/userdata" 
DEBU[0000] Container "12410d146b11430b5bfee809b0e435a237bd429808c916c30d808e9e89959f22" has run directory "/run/user/1000/containers/overlay-containers/12410d146b11430b5bfee809b0e435a237bd429808c916c30d808e9e89959f22/userdata" 
12410d146b11430b5bfee809b0e435a237bd429808c916c30d808e9e89959f22
DEBU[0000] Called create.PersistentPostRunE(podman create --log-level=debug quay.io/fedora/fedora:43) 
DEBU[0000] Shutting down engines                        
INFO[0000] Received shutdown.Stop(), terminating!        PID=9333

I guess podman-remote needs to query remote container storage so that's why you see the POST libpod/images/pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants