Skip to content

Add OCI ref.name to unique key in remotes handler#5299

Merged
estesp merged 1 commit intocontainerd:masterfrom
estesp:refkey-with-name
Apr 1, 2021
Merged

Add OCI ref.name to unique key in remotes handler#5299
estesp merged 1 commit intocontainerd:masterfrom
estesp:refkey-with-name

Conversation

@estesp
Copy link
Copy Markdown
Member

@estesp estesp commented Apr 1, 2021

This allows a pusher to be used for more than one tag without creating a
new resolver/pusher. The current implementation checks the ref key
tracker status based on type and hash and will skip the push even if the
repository reference is unique.

Signed-off-by: Phil Estes [email protected]

Note: refkeys are visually used in ctr images pull for status, which will be impacted by this change, but many images do not use the OCI annotations at this point, so impact seems minimal; for example with this patch, you can see the official alpine image has no ref.name annotation so the output is unchanged:

$ sudo bin/ctr images pull
ctr: please provide an image reference to pull
docker.io/library/alpine:latest:                                                  resolved       |++++++++++++++++++++++++++++++++++++++|
index-sha256:ec14c7992a97fc11425907e908340c6c3d6ff602f5f13d899e6b7027c9b4133a:    done           |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:e103c1b4bf019dc290bcc7aca538dc2bf7a9d0fc836e186f5fa34945c5168310: done           |++++++++++++++++++++++++++++++++++++++|
config-sha256:49f356fa4513676c5e22e3a8404aad6c7262cc7aaed15341458265320786c58c:   done           |++++++++++++++++++++++++++++++++++++++|
layer-sha256:ca3cd42a7c9525f6ce3d64c1a70982613a8235f0cc057ec9244052921853ef15:    done           |++++++++++++++++++++++++++++++++++++++|
elapsed: 0.9 s                                                                    total:  3.6 Ki (3.9 KiB/s)
unpacking linux/amd64 sha256:ec14c7992a97fc11425907e908340c6c3d6ff602f5f13d899e6b7027c9b4133a...
done: 71.951599ms

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 1, 2021

Build succeeded.

Comment thread remotes/handlers.go Outdated
This allows a pusher to be used for more than one tag without creating a
new resolver/pusher. The current implementation checks the ref key
tracker status based on type and hash and will skip the push even if the
repository reference is unique.

Signed-off-by: Phil Estes <[email protected]>
@estesp estesp force-pushed the refkey-with-name branch from fd65b4a to 7ae0a60 Compare April 1, 2021 18:20
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Apr 1, 2021

Build succeeded.

Copy link
Copy Markdown
Member

@dmcgowan dmcgowan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

@Zyqsempai Zyqsempai left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 251e3d1 into containerd:master Apr 1, 2021
@estesp estesp deleted the refkey-with-name branch April 1, 2021 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants