-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Remove Job from Info API #12266
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
Remove Job from Info API #12266
Conversation
daemon/info.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.
Even if the result is just an array of strings, let's either create a new type in api/types or just use []string instead of engine.Env because I'm hoping engine.Env goes away, eventually.
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 there any reason we're not typing all of the results here? IOW, create a real struct for all of the data with the proper types info.
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.
Yup, +1. Env is superbad.
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.
get it
api/server/server.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.
It is better to use simple form without else. Also it is recommended by google:
https://code.google.com/p/go-wiki/wiki/CodeReviewComments#Indent_Error_Flow
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 update this
api/server/server.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.
Just pass info, should work.
|
Ok for me. What about test? Maybe there is already some in |
|
I am plan to add a new file integration-cli/docker_api_info_test.go to do the test. It's on the way. |
|
Test ready. @LK4D4 @jfrazelle Since the CLI command |
|
Please squash your commits down to one. |
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.
sockRequest changed signature in master. Now you can get StatusCode and check it. Also maybe makes sense to unmarshall body to some temp structure for checking that important fields is in there.
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.
ok
|
@duglin I'll do it. |
|
I'm trying to fix this CI error: |
api/client/info.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.
I don't think we need this error message here since we're returning error below.
Maybe update the error with this extra info, though?
|
:( needs rebase. |
|
@cpuguy83 rebased |
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.
Can we have simple test for cli too? Because it was changed. Or maybe there is already tests?
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.
We have it under integration-cli/docker_cli_info_test.go
|
LGTM |
Two main things - Create a real struct Info for all of the data with the proper types - Add test for REST API get info Signed-off-by: Hu Keping <hukeping@huawei.com>
|
LGTM |
a part of issue #12151
Signed-off-by: Hu Keping hukeping@huawei.com