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

Better error message for BuildManifestURL if not tagged or digested #2203

Merged
merged 1 commit into from Mar 3, 2017

Conversation

clnperez
Copy link
Contributor

@clnperez clnperez commented Mar 1, 2017

Since there's no default case, if there's not a tag or digest you get
back a confusing error from the router about it not matching the
expected pattern.

Also redoing the tests for URLs a bit so that they can handle checking
for failures.

Signed-off-by: Christy Perez christy@linux.vnet.ibm.com

@@ -175,6 +176,8 @@ func (ub *URLBuilder) BuildManifestURL(ref reference.Named) (string, error) {
tagOrDigest = v.Tag()
case reference.Digested:
tagOrDigest = v.Digest().String()
default:
return "", fmt.Errorf("Named Reference must have tag or digest")
Copy link
Contributor

Choose a reason for hiding this comment

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

Error messages should generally start with a lowercase character.

I'd suggest reference must have a tag or digest.

Since there's no default case, if there's not a tag or digest you get
back a confusing error from the router about it not matching the
expected pattern.

Also redoing the tests for URLs a bit so that they can handle checking
for failures.

Signed-off-by: Christy Perez <christy@linux.vnet.ibm.com>
@clnperez
Copy link
Contributor Author

clnperez commented Mar 2, 2017

@aaronlehmann I changed that err msg, thanks!

@aaronlehmann
Copy link
Contributor

LGTM

1 similar comment
@dmcgowan
Copy link
Collaborator

dmcgowan commented Mar 3, 2017

LGTM

@dmcgowan dmcgowan merged commit 08b06dc into distribution:master Mar 3, 2017
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

3 participants