From 8e667c4165a9f8206d1c6b8c45a65153dc00cf3a Mon Sep 17 00:00:00 2001 From: owensmallwood Date: Thu, 10 Oct 2024 06:43:16 -0600 Subject: [PATCH] Search POC: Fixes search request tenant id (#94511) fixes search request tenant id --- pkg/services/unifiedSearch/service.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/services/unifiedSearch/service.go b/pkg/services/unifiedSearch/service.go index 4874a62858a..6f2b29e97c5 100644 --- a/pkg/services/unifiedSearch/service.go +++ b/pkg/services/unifiedSearch/service.go @@ -3,6 +3,7 @@ package unifiedSearch import ( "context" "errors" + "fmt" "github.com/grafana/grafana-plugin-sdk-go/backend" "github.com/grafana/grafana-plugin-sdk-go/data" @@ -158,7 +159,8 @@ func (s *StandardSearchService) doQuery(ctx context.Context, signedInUser *user. func (s *StandardSearchService) doSearchQuery(ctx context.Context, qry Query, _ string) *backend.DataResponse { response := &backend.DataResponse{} - req := &resource.SearchRequest{Tenant: s.cfg.StackID, Query: qry.Query, Limit: int64(qry.Limit), Offset: int64(qry.From)} + tenantId := fmt.Sprintf("stacks-%s", s.cfg.StackID) + req := &resource.SearchRequest{Tenant: tenantId, Query: qry.Query, Limit: int64(qry.Limit), Offset: int64(qry.From)} res, err := s.resourceClient.Search(ctx, req) if err != nil { s.logger.Error("Failed to search resources", "error", err)