Skip to content
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

Add label selectors to argo cron list command #11158

Closed
dbragdonmw opened this issue May 31, 2023 · 2 comments · Fixed by #11202
Closed

Add label selectors to argo cron list command #11158

dbragdonmw opened this issue May 31, 2023 · 2 comments · Fixed by #11202
Labels
area/cli The `argo` CLI type/feature Feature request

Comments

@dbragdonmw
Copy link

Summary

My team has many different cronworkflows, and we often use the argo cron list command to summarize them. Sometimes we wish to only view different groups of related workflows, which we cluster together using kubernetes labels. We really like the functionality of argo cron list for the information it provides regarding last runs, next runs, etc, but sometimes we only want to select a subset of cronworkflows based on specific labels. Currently our solution is to pipe the output of argo cron list to something like grep, but this only allows us to filter the result based on the name of the cronworkflow.

I would like for there to be a label selector option when using the argo cron list command. I imagine it would look something like this:

argo cron list -l environment=production,client=importantclient -n argo

Where these labels are stored in the metadata of the cronworkflow itself:

apiVersion: argoproj.io/v1alpha1
kind: CronWorkflow
metadata:
   name: my-cronwf
   labels:
      environment: production
      client: importantclient

What change needs making?

It appears that there is a labelSelector being used in

listOpts.LabelSelector = labelSelector.String()

Perhaps this can be extended to appropriate the labels passed by the user before querying the kubernetes cluster for existing cronworkflows?

Use Cases

When would you use this?

As noted above, it would be quite useful to utilize label selectors when querying for cronworkflows, especially when teams like ours have many, in order to give a glimpse at how certain "groups" of cronworkflows are running in our cluster. As another example, if a team has multiple cron workflows related to a specific use case, such as all cronworkflows configured for a specific business client, it would be useful use label selectors to grab all cronworkflows related to that client, in order to get an easily readable summary, rather than the entire list of cronworkflows in your cluster/namespace.

Thank you argo team for your time and for an amazing product!


Message from the maintainers:

Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.

@dbragdonmw dbragdonmw added the type/feature Feature request label May 31, 2023
@terrytangyuan
Copy link
Member

This would be a good enhancement. Would you like to contribute to it?

@dbragdonmw
Copy link
Author

This would be a good enhancement. Would you like to contribute to it?

I can't promise that I can deliver it in timely fashion but I can take a crack at it!

dbragdon1 added a commit to dbragdon1/argo-workflows that referenced this issue Jun 10, 2023
Signed-off-by: Dylan Bragdon <dylan.bragdon@gmail.com>
dbragdon1 added a commit to dbragdon1/argo-workflows that referenced this issue Jun 11, 2023
Signed-off-by: Dylan Bragdon <dylan.bragdon@gmail.com>
dbragdon1 added a commit to dbragdon1/argo-workflows that referenced this issue Jun 26, 2023
Signed-off-by: Dylan Bragdon <dylan.bragdon@gmail.com>
dbragdon1 added a commit to dbragdon1/argo-workflows that referenced this issue Jun 26, 2023
Signed-off-by: Dylan Bragdon <dylan.bragdon@gmail.com>
terrytangyuan pushed a commit that referenced this issue Jun 26, 2023
Signed-off-by: Dylan Bragdon <dylan.bragdon@gmail.com>
JPZ13 pushed a commit to pipekit/argo-workflows that referenced this issue Jul 4, 2023
…rgoproj#11202)

Signed-off-by: Dylan Bragdon <dylan.bragdon@gmail.com>
@agilgur5 agilgur5 added the area/cli The `argo` CLI label Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli The `argo` CLI type/feature Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants