-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Support parallel kill,rm #26778
Support parallel kill,rm #26778
Conversation
} | ||
|
||
errChan := parallelOperation(ctx, opts.containers, func(ctx context.Context, id string) error { | ||
if id == "" { | ||
return fmt.Errorf("Container name cannot be empty") |
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.
"Container ID .."?
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.
Not indeed. It can be either container id or container name, up to input from user. 😄
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.
One nit comment but overall LGTM 🐸
} | ||
|
||
errChan := parallelOperation(ctx, opts.containers, func(ctx context.Context, id string) error { | ||
if id == "" { |
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.
nameOrId
👼 ?
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.
OK
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.
Maybe container
is better? it covers name and id 😄
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.
true 👍
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
3e856b4
to
2b77325
Compare
I'm a bit concerned about this PR, but I might be missing something in the code. How does this impact the UX of the cmds? For example, how do we guarantee that the output isn't overlapping? Right now with cmds that take multiple containers as args there's a guarantee that the output will always be in a certain order, and it will follow the exact list of container IDs specified on the cmd line. This allows people to easily correlate which bit of output goes with which container. This PR appears to remove that guarantee, meaning the user then has to figure out which output goes with which container. Do we guarantee that ALL output from each kill/rm has enough uniquely identifying information (like the container name/id) in the output to always allow this correlation? |
@duglin don't worry, we have the output order gurantee 😄 . See #24761 (comment) in PR: #24761 I made a generic public function |
ok cool - wasn't sure from looking at the code. I did notice we show the errors/ID in the right order, but wasn't sure if there would ever be any other output that's sent to stderr/stdout. Guess not. |
@duglin I think the output should be right. What do you think of this? 😄 |
What's the current status? ping @mlaventure @thaJeztah |
This LGTM 👍 |
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.
Tested this, and works as advertised
LGTM as well
Don't think we need documentation changes for this, other than a mention in the changelog |
Support parallel kill,rm
Signed-off-by: Zhang Wei zhangwei555@huawei.com