Search: fix uid/name filter (#98981)

[search] fix uid/name filter
This commit is contained in:
Scott Lepper 2025-01-14 15:48:14 -05:00 committed by GitHub
parent feb334cdbb
commit 3b8477dcda
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1717,7 +1717,7 @@ func (dr *DashboardServiceImpl) searchDashboardsThroughK8sRaw(ctx context.Contex
if len(query.DashboardUIDs) > 0 {
request.Options.Fields = []*resource.Requirement{{
Key: "key.name",
Key: "name",
Operator: string(selection.In),
Values: query.DashboardUIDs,
}}
@ -1791,6 +1791,10 @@ func (dr *DashboardServiceImpl) searchDashboardsThroughK8sRaw(ctx context.Contex
request.Options.Fields = append(request.Options.Fields, req...)
}
if query.Limit > 0 {
request.Limit = query.Limit
}
res, err := dr.k8sclient.getSearcher().Search(ctx, request)
if err != nil {
return nil, err