podstorage: Skip podman image exists for non-storage transports - #2410
Merged
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
podman image existsonly 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 theImageReferenceparser and returnfalsedirectly, which is what the caller already inferred from the non-zero exit status. We can then skip runningpodman image existsalltogether 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, thenbootc switchis pointed at that directory.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.
Assisted-by: AI