Repository navigation
podstorage: Check image existence using image IDs - #2693
Merged
Merged
Conversation
Johan-Liebert1
requested review from
cgwalters
and
a balanced review from Copilot
November 25, 2026 03:40
Johan-Liebert1
force-pushed
the
fix-2640
branch
2 times, most recently
from
November 26, 2026 03:40
5bc551d to
c87751c
Compare
| } | ||
| // The bound image might've been skipped on installation | ||
| // So, don't throw an error if we fail to find it | ||
| Err(e) => { |
Contributor
There was a problem hiding this comment.
If inspect_image() fails, we continue without protecting this bound image. bound_roots are only matched by ID below, not by name, so an inspect failure can make an existing required image eligible for removal.
Could we fail/skip the prune on operational inspection errors, while still allowing a genuinely absent bound image?
Ran into an issue where I'd specified, in the LBI file, the name of an images as `Image=nginx:1.31.9-alpine-slim`. The pruning function gathered a list of all present images locally and ended up with `docker/library/nginx:1.31.9-alpine-slim` which did not match the name I had in the `.image` file and the image ended up being pruned. Fix this by gathering image IDs for all bound images and only prune the image if we can't find it by name and by ID. We still have to search by name as we can't be sure if the image which provisioned the system is present on the system or not. Fixes: bootc-dev#2640 tmt: Add test for bootc-dev#2640 Signed-off-by: Pragyan Poudyal <[email protected]>
On an inspect failure, first try to recover the ID from the image list we already fetched by matching on name, so the image stays protected without aborting the whole prune. If no name matches, use a strict existence check to distinguish a genuinely absent bound image from one that is present but unresolvable, and fail the prune in the latter case rather than risk removing a required image Add exists_strict(), which reads `podman image exists` exit codes - 0 present, 1 absent, other operational error - so a transient failure is no longer treated as an absence of an image Signed-off-by: Pragyan Poudyal <[email protected]>
Johan-Liebert1
force-pushed
the
fix-2640
branch
from
November 30, 2026 06:16
c87751c to
b8dbf7b
Compare
gursewak1997
enabled auto-merge (squash)
November 30, 2026 20:02
gursewak1997
approved these changes
Nov 30, 2026
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.
Ran into an issue where I'd specified, in the LBI file, the name of an images as
Image=nginx:1.31.9-alpine-slim. The pruning function gathered a list of all present images locally and ended up withdocker/library/nginx:1.31.9-alpine-slimwhich did not match the name I had in the.imagefile and the image ended up being pruned.Fix this by gathering image IDs for all bound images and only prune the image if we can't find it by name and by ID. We still have to search by name as we can't be sure if the image which provisioned the system is present on the system or not.
Fixes: #2640
tmt: Add test for #2640