feat: Added label selectors to argo cron list. Fixes #11158 #11202
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #11158 by adding label selectors to
argo cron list
command.Motivation
As stated in #11158 :
Modifications
Added
--selector
flag toargo cron list
command to support selectively queryingCronWorkflow
objects based on labels defined undermetadata
section. Functionality is identical to thekubectl
--selector
flag.Optional
-l
flag now appears in usage message:Example:
If a workflow is created with the following metadata:
You can query for this label by running
argo cron list -l client=importantclient
or
argo cron list --selector client=importantclient
and the result will be the standard
argo cron list
output:Verification
Added
List with Labels
unit test totest/e2e/cli_test.go
which creates two cron workflows, one with labelclient: importantclient
and one without, callsargo cron list -l client=importantclient
, and makes sure that only cron workflow with appropriate labels is selected.