-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
feat(cli): Add a flag status to delete cmd like list cmd of argo cli #11577
feat(cli): Add a flag status to delete cmd like list cmd of argo cli #11577
Conversation
cd08b7e
to
2229fba
Compare
#11557 does something similar, but I don't think flag pending makes sense, there shouldn't be such a tiny, fine-grained flag. Also thanks for his/her PR. 🙏 |
Agreed with this rationale. After you brought up the inadequacy of Moreover, |
I would normally agree with this, but given that there are already In any case, I think that discussion should be had in that PR. This PR does not technically preclude that PR |
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 tiny comment I need to look at more closely, otherwise LGTM.
Thanks for your contribution!
Thank's for your review, your analysis is very detailed and careful. 👍 💯 |
2229fba
to
202fc95
Compare
Signed-off-by: spencercjh <spencercjh@gmail.com>
202fc95
to
34af3da
Compare
Motivation
For #11555. @tooptoop4 wants to filter workflows more accurately and flexibly by status.
There are two supported flags associated with it:
--field-selector
:metadata.name=foo
,metadata.namespace=bar
--selector
:workflows.argoproj.io/phase=Succeeded
It is not feasible to use the
--field-selector
to filter workflows by status because of the well-known reasons.Using
-l(--selector)
would satisfy the need, but the labels are too long with a common prefixworkflows.argoproj.io/
. It is not convenient to use.Luckily,
argo list
has a directly related flag--status
to filter workflows by status likeargo list --status Running
. It is more convenient to use. I think it could be taken a step further by exempting users from using the shell combination likeargo delete $(argo list --status Succeeded | awk '{print $1}')
Modifications
--status
toargo delete
to filter workflows by status. It's an existing field of structlistFlags
and can be used directly.Verification
There was no test code for
argo delete
before. I run it locally and it works as expected.