-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Add the mediaType to the error #30047
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
Conversation
|
This test needs to be updated |
|
The CLI also expects the errors to have the current format: https://github.com/docker/docker/blob/de54284bd7cf4e1c8c255c61d0cf05533f3c2ba4/cli/command/image/pull.go#L77 |
|
@aaronlehmann fixed |
cli/command/image/pull.go
Outdated
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.
Perhaps the CLI should strip the mediatype here (and in the plugin case) to make the user-visible error less verbose.
I agree that having the mediatype in the general case is useful.
|
Can we focus this PR on just changing the message to include the media type when target is unknown, so |
|
I'd prefer we don't say the word "media type" to users. |
|
@stevvooe what would like it to say instead? |
|
@duglin It said |
|
@stevvooe see if you're ok with the new stuff |
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.
Aren't we fetching a plugin here?
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.
@stevvooe yea that is kind of funky - I tweaked it - see if this new one is any better.
|
@duglin Looks fine. There might be an inconsistency in the test. Added a comment. |
|
LGTM |
|
ping @tiborvass |
|
LGTM ping @tiborvass @anusha-ragunathan |
cli/command/image/pull.go
Outdated
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.
Is this correct? It doesn't seem consistent with the error generated by pullV2Tag.
|
I agree with @dmcgowan . Users dont need to be confused with |
|
@duglin what do you think about the last comments ? |
|
my concern with the word "target" is that is doesn't help someone know what's going on. "target" of what? At least "MediaType", to me, would indicate that some field in the metadata about the image is wrong. I would never have guess that "target" would refer to a field in the image. |
|
|
|
ok, I can live with "remote" more than "target" :-) will udpdate |
Without this fix the error the client might see is: target is unknown which wasn't helpful to me when I saw this today. With this fix I now see: MediaType is unknown: 'text/html' which helped me track down the issue to the registry I was talking to. Signed-off-by: Doug Davis <dug@us.ibm.com>
|
ping @tiborvass @anusha-ragunathan for a final LGTM I think |
|
LGTM |
1 similar comment
|
LGTM |
Add the mediaType to the error
Without this fix the error the client might see is:
target is unknownwhich wasn't helpful to me when I saw this today. With this fix I
now see:
MediaType is unknown: 'text/html'which helped me track down the issue to the registry I was talking to.
Signed-off-by: Doug Davis dug@us.ibm.com