-
Notifications
You must be signed in to change notification settings - Fork 453
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
add digest sub-flag for list image #163
Conversation
test case
|
/assign feiskyer |
@feiskyer @Random-Liu PTAL |
@Random-Liu @feiskyer PTAL |
cmd/crictl/image.go
Outdated
} | ||
repoDigest := normalizeRepoDigest(image.RepoDigests) | ||
repoTagPairs := normalizeRepoTagPair(image.RepoTags, image.RepoDigests) | ||
size := units.HumanSizeWithPrecision(float64(image.GetSize_()), 3) | ||
trunctedImage := strings.TrimPrefix(image.Id, "sha256:")[:truncatedImageIDLen] | ||
for _, repoTagPair := range repoTagPairs { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should combine repoDigest list and repoTag list, so that we don't need to handle repo digest separately in normalizeRepoTagPair
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
fix kubernetes-sigs#162 Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
@Random-Liu PTAL |
If my assumption above is correct, then it seems that 2) is not handled in this PR. @yanxuean Please first make sure my assumption is correct, I'm not sure about it actually. :) We only need to:
|
@Random-Liu Could you find some example images to convert those cases? |
Note that I removed all busybox image before each case. Case 1: $ docker pull busybox:latest
$ docker pull busybox@sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7
$ docker images | grep busybox
busybox latest 54511612f1c4 6 weeks ago 1.129 MB
$ docker images --digest | grep busybox
busybox latest sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7 54511612f1c4 6 weeks ago 1.129 MB Case 2: $ docker pull busybox@sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7
$ docker images | grep busybox
busybox <none> 54511612f1c4 6 weeks ago 1.129 MB
$ docker images --digests | grep busybox
busybox <none> sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7 54511612f1c4 6 weeks ago 1.129 MB Case 3: $ docker pull busybox:latest
$ docker pull busybox@sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7
$ docker pull busybox:1.27.2
$ docker images | grep busybox
busybox 1.27.2 54511612f1c4 6 weeks ago 1.129 MB
busybox latest 54511612f1c4 6 weeks ago 1.129 MB
$ docker images --digests | grep busybox
busybox 1.27.2 sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7 54511612f1c4 6 weeks ago 1.129 MB
busybox latest sha256:3e8fa85ddfef1af9ca85a5cfb714148956984e02f00bec3f7f49d3925a91e0e7 54511612f1c4 6 weeks ago 1.129 MB In this PR case 2 is not handled. As I mentioned, we should do:
|
ok, I will study it late. |
The case 2 has been handled.
|
@yanxuean Sorry, I missed that part. Then we are handling all the cases I could come up with. Thanks! |
fix #162
Signed-off-by: yanxuean yan.xuean@zte.com.cn