fix error message from docker inspect#1071
Merged
thaJeztah merged 1 commit intodocker:masterfrom May 21, 2018
Merged
Conversation
4c0b996 to
10c9014
Compare
tiborvass
reviewed
May 21, 2018
cli/command/system/inspect.go
Outdated
| v, raw, err := inspectData.objectInspector(ref) | ||
| if err != nil { | ||
| if typeConstraint == "" && (apiclient.IsErrNotFound(err) || isErrNotSupported(err)) { | ||
| if typeConstraint == "" && (apiclient.IsErrNotFound(err) || isErrorSkippable(err)) { |
Collaborator
There was a problem hiding this comment.
you might as well put IsErrNotFound into isErrorSkippable
Signed-off-by: Anda Xu <anda.xu@docker.com>
10c9014 to
d209043
Compare
thaJeztah
reviewed
May 21, 2018
|
|
||
| func isErrSkippable(err error) bool { | ||
| return apiclient.IsErrNotFound(err) || | ||
| strings.Contains(err.Error(), "not supported") || |
Member
There was a problem hiding this comment.
Wondering if this was actually checking for a "not implemented" error; https://github.com/moby/moby/blob/3a633a712c8bbb863fe7e57ec132dd87a9c4eff7/client/errors.go#L121
(not for this PR, but we should look at that)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signed-off-by: Anda Xu anda.xu@docker.com
- What I did
Fix docker inspect error message on invalid reference format to return generic message
Error: No such object:- How I did it
add error message checking
- How to verify it
- Description for the changelog
When
docker inspect FooBar, it is supposed to return the error messageError: No such object: FooBar. However it returnsError response from daemon: no such image: FooBar: invalid reference format: repository name must be lowercaseinstead. After the fix, it should return the former message.- A picture of a cute animal (not mandatory but encouraged)
cc @thaJeztah @tiborvass