Skip to content

Conversation

@duglin
Copy link
Contributor

@duglin duglin commented Jan 11, 2017

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

@AkihiroSuda
Copy link
Member

This test needs to be updated

00:42:29.420 ----------------------------------------------------------------------
00:42:29.421 FAIL: docker_cli_plugins_test.go:173: DockerRegistrySuite.TestPluginInstallImage
00:42:29.421 
00:42:29.421 docker_cli_plugins_test.go:184:
00:42:29.421     c.Assert(out, checker.Contains, "target is image")
00:42:29.421 ... obtained string = "Error response from daemon: MediaType is image: \"application/vnd.docker.container.image.v1+json\"\n"
00:42:29.422 ... substring string = "target is image"
00:42:29.422 
00:42:32.844 
00:42:32.844 ----------------------------------------------------------------------

@AkihiroSuda AkihiroSuda added status/2-code-review status/failing-ci Indicates that the PR in its current state fails the test suite and removed status/0-triage labels Jan 11, 2017
@duglin duglin removed the status/failing-ci Indicates that the PR in its current state fails the test suite label Jan 11, 2017
@duglin
Copy link
Contributor Author

duglin commented Jan 12, 2017

@aaronlehmann fixed

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.

@dmcgowan
Copy link
Member

Can we focus this PR on just changing the message to include the media type when target is unknown, so
target is unknown to target is unknown: text/html, changing target to MediaType is unnecessary and doesn't provide any better understanding, and including the media type when it is known and already properly interpreted also provides no help to the user. If we think the media type is potential useful for debugging then we can add a debug log.

@stevvooe
Copy link
Contributor

I'd prefer we don't say the word "media type" to users.

@duglin
Copy link
Contributor Author

duglin commented Jan 29, 2017

@stevvooe what would like it to say instead?

@stevvooe
Copy link
Contributor

@duglin It said target. The current error message doesn't even make sense: "MediaType is image" is a false statement.

@duglin
Copy link
Contributor Author

duglin commented Jan 31, 2017

@stevvooe see if you're ok with the new stuff

Copy link
Contributor

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?

Copy link
Contributor Author

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.

@stevvooe
Copy link
Contributor

@duglin Looks fine.

There might be an inconsistency in the test. Added a comment.

@stevvooe
Copy link
Contributor

stevvooe commented Feb 1, 2017

LGTM

@vieux
Copy link
Contributor

vieux commented Feb 1, 2017

ping @tiborvass

@vieux
Copy link
Contributor

vieux commented Feb 14, 2017

LGTM ping @tiborvass @anusha-ragunathan

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.

@anusha-ragunathan
Copy link
Contributor

#30047 (comment)

I agree with @dmcgowan . Users dont need to be confused with MediaType info, when a target is known.

@vieux
Copy link
Contributor

vieux commented Feb 28, 2017

@duglin what do you think about the last comments ?

@duglin
Copy link
Contributor Author

duglin commented Feb 28, 2017

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.

@anusha-ragunathan
Copy link
Contributor

target is not a field in the image/plugin. It is the remote that the user is referring to.
remote is also an appropriate term. eg. remote is plugin or remote is image

@duglin
Copy link
Contributor Author

duglin commented Feb 28, 2017

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>
@duglin
Copy link
Contributor Author

duglin commented Mar 8, 2017

ping @tiborvass @anusha-ragunathan for a final LGTM I think

@anusha-ragunathan
Copy link
Contributor

LGTM

1 similar comment
@tiborvass
Copy link
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants