Skip to content

Commit f0da6d2

Browse files
committedMar 18, 2025··
lib/container_manifest: check for image before manifest
There's an asymmetry between `podman image exists` and `podman manifest exists`. The first will return 1 if the image is a manifest. The second will return 125 if the image is _not_ a manifest. I think this is probably a bug in podman, but for now we can work around this by reverting the order in which we do the checking. That way, if the image exists but isn't a manifest, we'll return `True` and not actually call `podman manifest exists` on it.
1 parent 0c8d8d4 commit f0da6d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/cosalib/container_manifest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ def local_container_manifest_or_image_exists(repo, tag):
2626
@param repo str registry repository
2727
@param tag str tag
2828
'''
29-
cmds = [["podman", "manifest", "exists", f"{repo}:{tag}"],
30-
["podman", "image", "exists", f"{repo}:{tag}"]]
29+
cmds = [["podman", "image", "exists", f"{repo}:{tag}"],
30+
["podman", "manifest", "exists", f"{repo}:{tag}"]]
3131
for cmd in cmds:
3232
cp = runcmd(cmd, check=False)
3333
# The commands returns 0 (exists), 1 (doesn't exist), 125 (other error)

0 commit comments

Comments
 (0)
Please sign in to comment.