fix panic when containerd-stress density --count 0#7748
Conversation
|
Hi @yanggangtony. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
| count = cliContext.Int("count") | ||
| ) | ||
| if count <= 0 { | ||
| logrus.Warnf("flag count:%v can not be less than 0", count) |
There was a problem hiding this comment.
No need to warn, just return error if the argument is invalid
d2cc2bc to
dc9cf81
Compare
|
@dmcgowan |
| if count <= 0 { | ||
| return nil | ||
| } |
There was a problem hiding this comment.
| if count <= 0 { | |
| return nil | |
| } | |
| if count < 1 { | |
| return errors.New("count cannot be less than one") | |
| } |
There was a problem hiding this comment.
@samuelkarp
😄 , Thank you for dedicating your time to review it.
So , we need to notify user , he / she is wrong to fill the parameters..
Signed-off-by: yanggang <[email protected]>
dc9cf81 to
b0dd506
Compare
Signed-off-by: yanggang [email protected]
/kind bug
Fix panic , when user input --count 0 or <0 meaningless number.
before is :

fix after is:
