-
Notifications
You must be signed in to change notification settings - Fork 950
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
fixes: top options can't work #2252
fixes: top options can't work #2252
Conversation
Codecov Report
|
We found this is your first time to contribute to Pouch, @lifubang |
Thanks a lot for your contribution. @lifubang |
So, change to get? |
I think we need to update the swagger.yml to make method to be |
cli/top.go
Outdated
@@ -31,7 +31,8 @@ func (top *TopCommand) Init(c *Cli) { | |||
RunE: func(cmd *cobra.Command, args []string) error { | |||
return top.runTop(args) | |||
}, | |||
Example: topExamples(), | |||
Example: topExamples(), | |||
DisableFlagParsing: true, |
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.
Thanks a lot for this update. While for other commands like create
, run
and so on, we use flagSet.SetInterspersed(false)
in
func (cc *CreateCommand) addFlags() {
flagSet := cc.cmd.Flags()
flagSet.SetInterspersed(false)
c := addCommonFlags(flagSet)
cc.container = c
}
How about making pouchd use the unified way of flagSet.SetInterspersed(false)
?
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 have finished.
Do you use wechat or DingTalk? Please add me as a friend with account 15869045568. Thanks a lot. @lifubang |
bfcc32a
to
76083c4
Compare
OK, wait a minute. |
1460498
to
c5f707f
Compare
Signed-off-by: Lifubang <lifubang@acmcoder.com>
Thanks again for the fix. While when I was checking the cli integration test, I found that there is no integration test for the args of |
Thanks for the test cased added. I feel that we are almost there. Currently there is still some minor issue in code style:
Is the goimport failing or something esle? @lifubang |
f3250bc
to
a26a864
Compare
a26a864
to
4f19620
Compare
Codecov Report
@@ Coverage Diff @@
## master #2252 +/- ##
==========================================
- Coverage 66.77% 65.52% -1.26%
==========================================
Files 208 208
Lines 16923 16924 +1
==========================================
- Hits 11301 11090 -211
- Misses 4262 4508 +246
+ Partials 1360 1326 -34
|
I am afraid that CLI integration test fails:
@lifubang PTAL. |
4f19620
to
b488094
Compare
Signed-off-by: Lifubang <lifubang@acmcoder.com>
LGTM |
Signed-off-by: Lifubang lifubang@acmcoder.com
Ⅰ. Describe what this PR did
When pouch top --help:
top command is to display the running processes of a container.You can add options just like using Linux ps command.
But when I run: pouch top redisps -aux
It returns:
Error: unknown shorthand flag: 'a' in -aux
in https://github.com/alibaba/pouch/blob/master/docs/api/HTTP_API.md
Display the running processes of a container
POST /containers/{id}/top
But in https://github.com/alibaba/pouch/blob/master/client/container_top.go#L19
and https://github.com/alibaba/pouch/blob/master/apis/server/router.go#L57
The type is get.
And, in https://github.com/alibaba/pouch/blob/master/apis/server/container_bridge.go#L323
It uses req.Form.Get
Is post? or get?
Ⅱ. Does this pull request fix one issue?
NONE
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
Yes, you already had test cases.
Ⅳ. Describe how to verify it
pouch top redisps -aux
Ⅴ. Special notes for reviews
Make pouch top options work
API use get method