Skip to content

podstorage: Skip podman image exists for non-storage transports - #2410

Merged
cgwalters merged 1 commit into
bootc-dev:mainfrom
yeetypete:fix/image-exists-transport
Aug 26, 2026
Merged

podstorage: Skip podman image exists for non-storage transports#2410
cgwalters merged 1 commit into
bootc-dev:mainfrom
yeetypete:fix/image-exists-transport

Conversation

@yeetypete

@yeetypete yeetypete commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

podman image exists only resolves names in local storage, so a reference with any other transport (oci:, docker://, ...) makes it fail with an error on stderr. Check the transport up front using the ImageReference parser and return false directly, which is what the caller already inferred from the non-zero exit status. We can then skip running podman image exists alltogether and avoid the stderr messages.

Example "failure" cases where we get some unwanted stderr from podman:

Case 1: switching to a locally built image via --transport oci, with the OCI layout present on disk. The image is exported to an OCI directory with podman push, then bootc switch is pointed at that directory.

podman push --quiet --compression-format zstd docker.io/yeetypete/bootc-ubuntu:26.04 oci:image.oci:26.04-49b8e14
sudo bootc switch --transport oci  /var/home/psiegel/bootc-ubuntu/image.oci:26.04-49b8e14
[sudo: authenticate] Password:
Error: unsupported transport "oci" for looking up local images
Error: unsupported transport "oci" for looking up local images
Importing 129 layers from OCI layout

Case 2: switching to a registry image while the booted deployment still refers to an oci: layout, and that layout directory no longer exists on disk. Note that the switch itself is not aborted.

Error: parsing reference "oci:/var/home/psiegel/bootc-ubuntu/image.oci:26.04-49b8e14": invalid reference format

Assisted-by: AI

`podman image exists` only resolves names in local storage, so a
reference with any other transport (`oci:`, `docker://`, ...) makes it
fail with an error on stderr. Check the transport up front using the
`ImageReference` parser and return `false` directly, which is what the
caller already inferred from the non-zero exit status.

Assisted-by: AI
Signed-off-by: Peter Siegel <psiegel2000@icloud.com>
@bootc-bot
bootc-bot Bot requested a review from ckyrouac August 25, 2026 23:27

@Johan-Liebert1 Johan-Liebert1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@cgwalters
cgwalters merged commit 705850f into bootc-dev:main Aug 26, 2026
53 checks passed
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