image: Fix dangling image detection with graphdrivers#6704
Merged
thaJeztah merged 5 commits intodocker:masterfrom Dec 12, 2025
Merged
image: Fix dangling image detection with graphdrivers#6704thaJeztah merged 5 commits intodocker:masterfrom
thaJeztah merged 5 commits intodocker:masterfrom
Conversation
The isDangling function was incorrectly identifying images as dangling when they had no RepoTags but had valid RepoDigests. This can occur when the graphdrivers are used instead of the containerd image store. An image should only be considered dangling if it has no RepoTags, regardless of whether it has RepoDigests. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
When calculating column widths for the tree view, untagged images weren't being properly accounted for in the width calculation. This caused layout issues when there were tagged images were shorter than the `<untagged>` string. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
…ed view This reverts part of the logic introduced in 207bf52 which incorrectly gated untagged images behind the --all flag in non-expanded view. The original fix was addressing the wrong layer of the problem. The actual issue was that dangling images were being incorrectly passed to the tree code in the first place. This was properly fixed in 67f5e34 which corrected the dangling image detection logic to properly filter them out before reaching the tree display code. Now that dangling images are correctly filtered upstream, untagged images that reach the tree view should be displayed regardless of the --all flag setting. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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.
docker image ls -f dangling=trueshows no images unless-ais also specified #6699image: Fix dangling image detection with graphdrivers
The isDangling function was incorrectly identifying images as dangling
when they had no RepoTags but had valid RepoDigests.
This can occur when the graphdrivers are used instead of the containerd
image store.
An image should only be considered dangling if it has no RepoTags,
regardless of whether it has RepoDigests.
image/tree: Extract untagged image name to const
image/tree: Fix width calculation for untagged images
When calculating column widths for the tree view, untagged images
weren't being properly accounted for in the width calculation.
This caused layout issues when there were tagged images were shorter
than the
<untagged>string.image/tree: Remove --all flag check for untagged images in non-expanded view
This reverts part of the logic introduced in 207bf52 which
incorrectly gated untagged images behind the --all flag in non-expanded
view.
The original fix was addressing the wrong layer of the problem.
The actual issue was that dangling images were being incorrectly passed
to the tree code in the first place.
This was properly fixed in 67f5e34 which corrected the dangling image
detection logic to properly filter them out before reaching the tree
display code.
Now that dangling images are correctly filtered upstream, untagged
images that reach the tree view should be displayed regardless of the
--all flag setting.
image/tree: Add golden test