-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Search by name for WorkflowTemplates in UI #11004
Comments
Maybe using Elasticsearch can be usefull when also searching for Log. Because i like to find some flow that have same error log |
@terrytangyuan |
Feel free to submit a PR |
Hello, I am working on implementing the "name contains" filter functionality in the ArgoWorkflows UI to resolve this issue. As a result, I have implemented the list code as follows: func (wts *WorkflowTemplateServer) ListWorkflowTemplates(ctx context.Context, req *workflowtemplatepkg.WorkflowTemplateListRequest) (*v1alpha1.WorkflowTemplateList, error) {
wfClient := auth.GetWfClient(ctx)
options := &v1.ListOptions{}
if req.ListOptions != nil {
options = req.ListOptions
}
wts.instanceIDService.With(options)
wfList, err := wfClient.ArgoprojV1alpha1().WorkflowTemplates(req.Namespace).List(ctx, *options)
if err != nil {
return nil, sutils.ToStatusError(err, codes.Internal)
}
// My Code Start
if req.NamePattern != "" {
var items []v1alpha1.WorkflowTemplate
for _, item := range wfList.Items {
if strings.Contains(item.ObjectMeta.Name, req.NamePattern) {
items = append(items, item)
}
}
wfList.Items = items
}
// My Code End
sort.Sort(wfList.Items)
return wfList, nil
} I am contemplating how to proceed with pagination after applying the filtering. However, since I am currently facing a lot of considerations and seeking advice:
Since this feature is dependent on Kubernetes, making a decision on my own seems challenging, so I'm seeking advice. Thank you. |
As kubernetes api doesn't support pattern searching, so far I also think 'searching whole on every page move' OR 'some caching' is inevitable to make name pattern search UI. |
Summary
Add search bar in UI to search for WorkflowTemplates, ClusterWorkflowTemplates, CronWorkflows by name.
Use Cases
Searching by name makes sense if there is a large number of templates in a cluster. Some devs in our team submit WorkflowTemplates manually regularly. It's always a pain to scroll through all the templates.
Message from the maintainers:
Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.
The text was updated successfully, but these errors were encountered: