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

Fallback to repo digest name if repoTag is <none>:<none> #471

Merged
merged 1 commit into from
Jun 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cmd/crictl/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,9 @@ func getAuth(creds string, auth string) (*pb.AuthConfig, error) {
// Ideally repo tag should always be image:tag.
// The repoTags is nil when pulling image by repoDigest,Then we will show image name instead.
func normalizeRepoTagPair(repoTags []string, imageName string) (repoTagPairs [][]string) {
const none = "<none>"
if len(repoTags) == 0 {
repoTagPairs = append(repoTagPairs, []string{imageName, "<none>"})
repoTagPairs = append(repoTagPairs, []string{imageName, none})
return
}
for _, repoTag := range repoTags {
Expand All @@ -414,7 +415,11 @@ func normalizeRepoTagPair(repoTags []string, imageName string) (repoTagPairs [][
repoTagPairs = append(repoTagPairs, []string{"errorRepoTag", "errorRepoTag"})
continue
}
repoTagPairs = append(repoTagPairs, []string{repoTag[:idx], repoTag[idx+1:]})
name := repoTag[:idx]
if name == none {
name = imageName
}
repoTagPairs = append(repoTagPairs, []string{name, repoTag[idx+1:]})
}
return
}
Expand Down