From 3b8477dcda3537323bf04f5b21f825a95ececbca Mon Sep 17 00:00:00 2001 From: Scott Lepper Date: Tue, 14 Jan 2025 15:48:14 -0500 Subject: [PATCH] Search: fix uid/name filter (#98981) [search] fix uid/name filter --- pkg/services/dashboards/service/dashboard_service.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/services/dashboards/service/dashboard_service.go b/pkg/services/dashboards/service/dashboard_service.go index 2881db09436..05e08772a1d 100644 --- a/pkg/services/dashboards/service/dashboard_service.go +++ b/pkg/services/dashboards/service/dashboard_service.go @@ -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