Skip to content

[27.x] c8d/inspect: Fix duplicate RepoDigests #48785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2024
Merged

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented Oct 28, 2024

Multiple images with the same repository name but different tag caused the RepoDigests to contain duplicated entries for each of the image.

Use a set instead of a slice to store the digested references to avoid the duplicated values.

- How to verify it
TestImageInspectUniqueRepoDigests

- Description for the changelog

containerd image store: Fix `docker image inspect` outputting duplicate references in `RepoDigests`.

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

@vvoland vvoland added status/2-code-review kind/bugfix PR's that fix bugs containerd-integration Issues and PRs related to containerd integration labels Oct 28, 2024
@vvoland vvoland added this to the 27.4.0 milestone Oct 28, 2024
@vvoland vvoland self-assigned this Oct 28, 2024
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM

@vvoland
Copy link
Contributor Author

vvoland commented Oct 28, 2024

Oh, looks like this needs to be adjusted a bit more, because the inspect refactor didn't make it into the 27.x 🙈

@vvoland vvoland marked this pull request as draft October 28, 2024 14:08
@vvoland vvoland changed the title [27.x backport] c8d/inspect: Fix duplicate RepoDigests [27.x] c8d/inspect: Fix duplicate RepoDigests Oct 28, 2024
Multiple images with the same repository name but different tag caused
the `RepoDigests` to contain duplicated entries for each of the image.

Deduplicate the slice before setting the `RepoDigests` field.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit ba454f5)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland marked this pull request as ready for review October 30, 2024 09:33
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@thaJeztah thaJeztah merged commit 15ad1e4 into moby:27.x Oct 30, 2024
138 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/images containerd-integration Issues and PRs related to containerd integration impact/changelog kind/bugfix PR's that fix bugs status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants