Conversation
dockerURL := d2acommon.ParseDockerURL(path.Join(u.Host, u.Path)) | ||
dockerURL, err := d2acommon.ParseDockerURL(path.Join(u.Host, u.Path)) | ||
if err != nil { | ||
return "", fmt.Errorf("invalid docker URL %q. Syntax docker://[REGISTRY_HOST[:REGISTRY_PORT]/]IMAGE_NAME[:TAG]", u) |
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.
How about wrapping the error gotten from docker2aci?
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.
I thought about it, but I don't like the result: without --debug
, we only print the first and last errors, that is: run: empty Docker image reference
and I'd like to show the right syntax to the user.
Maybe we can modify the error in docker2aci, although it doesn't make sense to include the docker://
part because the function parses the part after the schema.
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.
Alright, fair enough.
Also, I'm not sure if I like the current error message being two sentences. How about:
fmt.Errorf(`invalid docker URL %q; syntax is "docker://blahblahblah"`, u)
Either semicolon or a comma and add a missing "is".
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.
I'll go with
fmt.Errorf(`invalid docker URL %q; expected syntax is "docker://[REGISTRY_HOST[:REGISTRY_PORT]/]IMAGE_NAME[:TAG]"`, u)
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.
Sure.
|
I don't think this is worthy for a changelog entry. It's just a bugfix. |
d7e681a
to
5e95afc
Compare
dockerURL := d2acommon.ParseDockerURL(path.Join(u.Host, u.Path)) | ||
dockerURL, err := d2acommon.ParseDockerURL(path.Join(u.Host, u.Path)) | ||
if err != nil { | ||
return "", fmt.Errorf(`invalid docker URL %q; expected syntax "docker://[REGISTRY_HOST[:REGISTRY_PORT]/]IMAGE_NAME[:TAG]"`, u) |
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.
You swallowed the "is" word.
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.
Achh
5e95afc
to
578f5af
Compare
LFAD. |
Fixes #2008
Closes #2134