-
Notifications
You must be signed in to change notification settings - Fork 948
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
feature: support multiple inspection #989
feature: support multiple inspection #989
Conversation
I am afraid that travisCI fails to run this PR, since there is one ci test missing. Also cc @HusterWan @Letty5411 to see is there anything we could do to guarantee the CI testing. |
@allencloud Done |
cli/inspect/inspector.go
Outdated
@@ -8,6 +8,7 @@ import ( | |||
|
|||
"github.com/alibaba/pouch/pkg/utils/templates" | |||
|
|||
"fmt" |
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.
Please move this built package fmt to line L6 of this file and gofmt this file, since we have made a rule of
When importing packages, to improve readabilities, we should import package by sequence: system packages, project's own packages and third-party packages. And we should keep a blank line among these three kinds of packages;
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.
omg, I will solve it.
Thanks for your reminder.
cli/image_inspect.go
Outdated
RunE: func(cmd *cobra.Command, args []string) error { | ||
return i.runInspect(args) | ||
Args: cobra.MinimumNArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { |
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 do not think that change RunE
into Run
is correct. Here is my reason: we need to know whether this command works or not via RunE
, since RunE
would return an error or nil.
With Run
, we cannot tell whether the command runs into error, this is a confusing situation for users. Users cannot use echo $?
to judge if it runs well, since the exit code is always 0.
WDYT? @faycheng
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.
Yes, you are right.I will rollback to RunE
.
7bc56ff
to
46a4ff2
Compare
already updated change request, dismissing
Got it. |
Signed-off-by: 程飞 <fay.cheng.cn@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #989 +/- ##
==========================================
- Coverage 13.73% 13.72% -0.02%
==========================================
Files 124 124
Lines 8358 8367 +9
==========================================
Hits 1148 1148
- Misses 7111 7120 +9
Partials 99 99
Continue to review full report at Codecov.
|
@allencloud Done. |
RunE: func(cmd *cobra.Command, args []string) error { | ||
return i.runInspect(args) | ||
return inspect.MultiInspect(args, i.runInspect) |
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 think we should call MultiInspect in runInspect
, because we may have some context to deal with in the future, WDYT?
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.
yes, the skill of dealing with context is necessary.and i will try to solve it.thanks.
@faycheng Thanks for your work. We are planning that merge this PR and leave two others for you to finish:
How about that? |
LGTM |
@allencloud Sorry for the late reply, because i stays very busy with my work on company. |
Signed-off-by: 程飞 fay.cheng.cn@gmail.com
Ⅰ. Describe what this PR did
Support multiple inspection inspired by the issue #922
Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews