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

Add remote.Put() to upload a manifest via digest #980

Merged
merged 1 commit into from
Apr 14, 2021

Conversation

deitch
Copy link
Collaborator

@deitch deitch commented Apr 12, 2021

As discussed with @jonjohnsonjr . We already have remote.Tag which uploads a manifest and references it with a tag. However, there also is the ability in the API to upload a manifest and just reference it via its digest, just like any other blob. Eventually, the manifest should be referenced by another manifest or a tag, but those are independent.

// Digest does not attempt to write anything other than the manifest, so callers
// should ensure that all blobs or manifests that are referenced by t exist
// in the target registry.
func Digest(digest name.Digest, t Taggable, options ...Option) error {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd lean towards just remote.Put for this, I think. The existing remote.Tag is using "tag" as a verb here, not as a noun, so calling this Digest doesn't make a ton of sense.

remote.Put would also mirror remote.Get, remote.Head, and remote.Delete.

It should take a name.Reference as well, IMO (basically just exposing manifestReference as Put).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done. Take a look.

@jonjohnsonjr
Copy link
Collaborator

LGTM, a test would be cool, but just rebasing also works :)

Signed-off-by: Avi Deitcher <avi@deitcher.net>
@deitch
Copy link
Collaborator Author

deitch commented Apr 14, 2021

Rebased.

@jonjohnsonjr jonjohnsonjr merged commit 7e30746 into google:main Apr 14, 2021
@jonjohnsonjr
Copy link
Collaborator

Thanks!

@jonjohnsonjr jonjohnsonjr changed the title Add remote.Digest() to upload a manifest via digest Add remote.Put() to upload a manifest via digest Apr 14, 2021
@deitch deitch deleted the push-manifest-digest branch April 15, 2021 06:08
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.

None yet

2 participants