Skip to content

c8d/list: Match graphdriver dangling filter behavior#46856

Closed
vvoland wants to merge 1 commit intomoby:masterfrom
vvoland:c8d-fix-TestListDanglingImagesWithDigests
Closed

c8d/list: Match graphdriver dangling filter behavior#46856
vvoland wants to merge 1 commit intomoby:masterfrom
vvoland:c8d-fix-TestListDanglingImagesWithDigests

Conversation

@vvoland
Copy link
Contributor

@vvoland vvoland commented Nov 27, 2023

The graphdriver implementation for treats digested but untagged images (for example pulled by digest) as a dangling images for dangling=true filter. The dangling=false should not filter out these images though.

Adjust the containerd image store implementation to match the old behavior.

- What I did

- How I did it

- How to verify it

  • Check TestListDanglingImagesWithDigests test result
$ docker images --all
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
<none>       <none>    a0ee2b04d87a   7 minutes ago   11.7MB
alpine       latest    eece025e4321   8 weeks ago     11.7MB
busybox      <none>    3fbc63216742   4 months ago    6.09MB

$ docker images --filter dangling=false
REPOSITORY   TAG       IMAGE ID       CREATED        SIZE
alpine       latest    eece025e4321   8 weeks ago    11.7MB
busybox      <none>    3fbc63216742   4 months ago   6.09MB

$ docker images --filter dangling=true
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
<none>       <none>    a0ee2b04d87a   6 seconds ago   11.7MB
busybox      <none>    3fbc63216742   4 months ago    6.09MB

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

The graphdriver implementation for  treats digested but untagged images
(for example pulled by digest) as a dangling images for `dangling=true`
filter. The `dangling=false` should not filter out these images though.

Adjust the containerd image store implementation to match the old behavior.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland added status/2-code-review area/images Image Distribution kind/bugfix PR's that fix bugs containerd-integration Issues and PRs related to containerd integration labels Nov 27, 2023
@vvoland vvoland added this to the 25.0.0 milestone Nov 27, 2023
@vvoland
Copy link
Contributor Author

vvoland commented Nov 27, 2023

I recall seeing ticket/report which mentioned it that would be addressed by this PR but I can't find it now. Anyone remembers which one it was or if I'm hallucinating? 🤔

@rumpl
Copy link
Member

rumpl commented Nov 28, 2023

I think we should disable this test for containerd, an image being dangling and not dangling at the same time is very weird and I don't like it

@vvoland
Copy link
Contributor Author

vvoland commented Nov 29, 2023

Opened #46868

@dmcgowan
Copy link
Member

I think disabling for now is fine. Getting it working like the previous list would probably involve taking multiple passes through the image list to determine whether an image reference doesn't have a corresponding tagged. Simply checking whether a single reference in containerd is untagged does not match what the UI may consider to be a dangling/untagged reference. Long term either moving away from the existing "dangling" definition in the UI probably makes sense but another cleaner solution could also be returning a larger set of references and letting the cli define/implement the reference collapsing and "dangling" filter.

@vvoland vvoland closed this Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/images Image Distribution containerd-integration Issues and PRs related to containerd integration kind/bugfix PR's that fix bugs status/2-code-review

Projects

Development

Successfully merging this pull request may close these issues.

3 participants