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

fix: make pouch network non-existent return exit code 1 #1089

Merged
merged 1 commit into from
Apr 10, 2018

Conversation

allencloud
Copy link
Collaborator

@allencloud allencloud commented Apr 10, 2018

Signed-off-by: Allen Sun allensun.shl@alibaba-inc.com

Ⅰ. Describe what this PR did

In the original code, parent command of Pouch has no execution function which could be tell users error happens.

I wish to add this into integration test, however I have no idea how to check exit code in test framework.

@sunyuan3

Ⅱ. Does this pull request fix one issue?

fix #1076

Ⅲ. Describe how you did it

add a RunE function in parent command.

Ⅳ. Describe how to verify it

root@ubuntu:~/go/src/github.com/alibaba/pouch# echo $?
1
root@ubuntu:~/go/src/github.com/alibaba/pouch#
root@ubuntu:~/go/src/github.com/alibaba/pouch#
root@ubuntu:~/go/src/github.com/alibaba/pouch# ./pouch network sdfghjk dfghj
Error: command 'pouch network sdfghjk' does not exist.
Please execute `pouch network --help` for more help
root@ubuntu:~/go/src/github.com/alibaba/pouch# echo $?
1
root@ubuntu:~/go/src/github.com/alibaba/pouch# ./pouch network
Error: requires at least 1 arg(s), only received 0
root@ubuntu:~/go/src/github.com/alibaba/pouch# echo $?
1

Ⅴ. Special notes for reviews

none

@pouchrobot pouchrobot added areas/network kind/bug This is bug report for project size/XS labels Apr 10, 2018
Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>
@codecov-io
Copy link

Codecov Report

Merging #1089 into master will increase coverage by 0.08%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1089      +/-   ##
==========================================
+ Coverage   16.46%   16.55%   +0.08%     
==========================================
  Files         161      161              
  Lines        8896     8838      -58     
==========================================
- Hits         1465     1463       -2     
+ Misses       7327     7272      -55     
+ Partials      104      103       -1
Impacted Files Coverage Δ
cli/volume.go 8.19% <0%> (-0.14%) ⬇️
cli/network.go 0% <0%> (ø) ⬆️
cli/cli.go 0% <0%> (ø) ⬆️
client/client.go 100% <0%> (+66.66%) ⬆️

@sunyuan3
Copy link
Contributor

LGTM

@pouchrobot pouchrobot added the LGTM one maintainer or community participant agrees to merge the pull reuqest. label Apr 10, 2018
@sunyuan3 sunyuan3 merged commit 15c9cbb into AliyunContainerService:master Apr 10, 2018
@allencloud allencloud deleted the fix-1076 branch April 10, 2018 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
areas/network kind/bug This is bug report for project LGTM one maintainer or community participant agrees to merge the pull reuqest. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] "pouch network NotExistOption" returns 0.
4 participants