Skip to content

c8d/inspect: Fix duplicate RepoDigests#48777

Merged
thaJeztah merged 1 commit intomoby:masterfrom
vvoland:c8d-inspect-duplicate-repodigests
Oct 28, 2024
Merged

c8d/inspect: Fix duplicate RepoDigests#48777
thaJeztah merged 1 commit intomoby:masterfrom
vvoland:c8d-inspect-duplicate-repodigests

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 process/cherry-pick/27.x labels Oct 28, 2024
@vvoland vvoland added this to the 28.0.0 milestone Oct 28, 2024
@vvoland vvoland self-assigned this Oct 28, 2024
@vvoland vvoland force-pushed the c8d-inspect-duplicate-repodigests branch from 0a85671 to a4a1e19 Compare October 28, 2024 09:22
@thaJeztah
Copy link
Member

@vvoland looks like someone else also just opened a PR for this 😂

@vvoland vvoland force-pushed the c8d-inspect-duplicate-repodigests branch from a4a1e19 to 8e2a376 Compare October 28, 2024 09:51
@vvoland vvoland force-pushed the c8d-inspect-duplicate-repodigests branch from 8e2a376 to 0d47a82 Compare October 28, 2024 10:14
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 <[email protected]>
@vvoland vvoland force-pushed the c8d-inspect-duplicate-repodigests branch 2 times, most recently from 1c00cb9 to ba454f5 Compare October 28, 2024 10:16
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 mentioned this pull request Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

containerd-integration Issues and PRs related to containerd integration kind/bugfix PR's that fix bugs process/cherry-picked status/2-code-review

Projects

Development

Successfully merging this pull request may close these issues.

c8d: image inspect should not contain duplicate RepoDigests

4 participants