Skip to content
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

containerd integration: verify RepoDigests, RepoTags works for untagged or multiple tags #43861

Open
thaJeztah opened this issue Jul 25, 2022 · 0 comments
Labels
area/images containerd-integration Issues and PRs related to containerd integration kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny

Comments

@thaJeztah
Copy link
Member

Description

Images may be present in the local image cache without having been pushed and/or tagged ("dangling").

The new code unconditionally includes RepoDigests and RepoTags;

RepoDigests: []string{img.Name() + "@" + img.Target().Digest.String()}, // "hello-world@sha256:bfea6278a0a267fad2634554f4f0c6f31981eea41c553fdf5a83e95a41d40c38"},
RepoTags: []string{img.Name()},

But also assumes an image always has a single tag (which may not be the case, e.g. ubuntu:latest and ubuntu:22.04 may be the same image).

The old code accounts for this situation, and (for backward compatibility) returns <none>:<none> as name/tag;

if summary.RepoDigests == nil && summary.RepoTags == nil {
if opts.All || len(i.imageStore.Children(id)) == 0 {
if opts.Filters.Contains("dangling") && !danglingOnly {
// dangling=false case, so dangling image is not needed
continue
}
if opts.Filters.Contains("reference") { // skip images with no references if filtering by reference
continue
}
summary.RepoDigests = []string{"<none>@<none>"}
summary.RepoTags = []string{"<none>:<none>"}
} else {
continue
}
} else if danglingOnly && len(summary.RepoTags) > 0 {

@thaJeztah thaJeztah added kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny area/images containerd-integration Issues and PRs related to containerd integration labels Jul 25, 2022
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 kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny
Projects
None yet
Development

No branches or pull requests

1 participant