Skip to content
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

bugfix: print error info twice when cmd unknown #2260

Merged
merged 1 commit into from
Sep 20, 2018

Conversation

starnop
Copy link
Contributor

@starnop starnop commented Sep 20, 2018

Signed-off-by: Starnop starnop@163.com

Ⅰ. Describe what this PR did

pouchContainer will print error info twice when command was unknown.

Ⅱ. Does this pull request fix one issue?

fixes #1529

Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)

No needed.

Ⅳ. Describe how to verify it

# pouch foo
Error: unknown command "foo" for "pouch"

Did you mean this?
	top

Run 'pouch --help' for usage.

Ⅴ. Special notes for reviews

Cobra will print automatic suggestions when "unknown command" errors happen.

@codecov
Copy link

codecov bot commented Sep 20, 2018

Codecov Report

Merging #2260 into master will decrease coverage by 0.14%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2260      +/-   ##
==========================================
- Coverage   66.84%   66.69%   -0.15%     
==========================================
  Files         208      208              
  Lines       16926    16926              
==========================================
- Hits        11314    11289      -25     
- Misses       4256     4271      +15     
- Partials     1356     1366      +10
Flag Coverage Δ
#criv1alpha1test 32.53% <ø> (-0.19%) ⬇️
#criv1alpha2test 36.17% <ø> (+0.19%) ⬆️
#integrationtest 39.54% <ø> (+0.04%) ⬆️
#nodee2etest 33.3% <ø> (-0.19%) ⬇️
#unittest 23.75% <ø> (ø) ⬆️
Impacted Files Coverage Δ
cri/ocicni/cni_manager.go 65% <0%> (-15%) ⬇️
daemon/containerio/cri_log_file.go 84.31% <0%> (-3.93%) ⬇️
daemon/mgr/system.go 76.22% <0%> (-1.64%) ⬇️
daemon/logger/jsonfile/utils.go 71.54% <0%> (-1.63%) ⬇️
daemon/mgr/spec_linux.go 74.47% <0%> (-1.51%) ⬇️
cri/v1alpha2/cri.go 66.46% <0%> (-0.9%) ⬇️
cri/v1alpha1/cri.go 61.52% <0%> (-0.34%) ⬇️
cri/v1alpha2/cri_utils.go 90.33% <0%> (-0.3%) ⬇️
daemon/mgr/container.go 57.39% <0%> (-0.21%) ⬇️
cri/v1alpha2/cri_wrapper.go 62.4% <0%> (ø) ⬆️
... and 1 more

@pouchrobot pouchrobot added kind/bug This is bug report for project size/XS labels Sep 20, 2018
@starnop starnop force-pushed the cli-cmd-error branch 4 times, most recently from 67de2e3 to 175d08f Compare September 20, 2018 08:09
Copy link
Contributor

@fuweid fuweid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fuweid
Copy link
Contributor

fuweid commented Sep 20, 2018

CI failed by adding one line

/home/travis/gopath/src/github.com/alibaba/pouch/test/cli_inspect_test.go:140:
    c.Assert(output, check.Equals, errCase.expectedOutput)
... obtained string = "" +
...     "\n" +
...     "Run 'pouch --help' for usage.\n" +
...     "Error: Fetch object error: {\"message\":\"container multi-inspect-print-1: not found\"}\n" +
...     "Error: Fetch object error: {\"message\":\"container multi-inspect-print-2: not found\"}\n"
... expected string = "" +
...     "\n" +
...     "Error: Fetch object error: {\"message\":\"container multi-inspect-print-1: not found\"}\n" +
...     "Error: Fetch object error: {\"message\":\"container multi-inspect-print-2: not found\"}\n"

Signed-off-by: Starnop <starnop@163.com>
@fuweid fuweid merged commit 97d41ba into AliyunContainerService:master Sep 20, 2018
@starnop starnop deleted the cli-cmd-error branch September 21, 2018 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug This is bug report for project size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] pouch print error info twice when command was unknown
3 participants