8000 Use reference package internally by aaronlehmann · Pull Request #1270 · distribution/distribution · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use reference package internally #1270

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

Closed

Conversation

aaronlehmann
Copy link
Contributor

Most places in the registry were using string types to refer to
repository names. This changes them to use reference.Named, so the type
system can enforce validation of the naming rules.

cc @dmcgowan @stevvooe

Most places in the registry were using string types to refer to
repository names. This changes them to use reference.Named, so the type
system can enforce validation of the naming rules.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
@dmcgowan
Copy link
Collaborator

LGTM

@@ -23,8 +24,8 @@ var _ Listener = &bridge{}

// URLBuilder defines a subset of url builder to be used by the event listener.
type URLBuilder interface {
BuildManifestURL(name, tag string) (string, error)
BuildBlobURL(name string, dgst digest.Digest) (string, error)
BuildManifestURL(name reference.Named, tag string) (string, error)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should this be reference.Tagged?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It should take reference.NamedTagged, and BuildBlobURL should take reference.Canonical. I'll make these changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've implemented this change at https://github.com/aaronlehmann/distribution/tree/use-reference-package-v2. It depends on #1268 and #1271, so I'm going to close this PR for now and reopen it when those PRs are merged.

(Slight correction to the above: BuildManifestURL will take a single reference.Named that may include a digest or tag.)

@aaronlehmann aaronlehmann deleted the use-reference-package branch December 18, 2015 01:10
@aaronlehmann aaronlehmann restored the use-reference-package branch January 8, 2016 22:22
@aaronlehmann
Copy link
Contributor Author

GitHub isn't letting me reopen this pull request with an updated branch. I've opened #1333 to replace this one.

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.

4 participants
0