From 6908f914282dbcab29fce89422ccf785b4330ac5 Mon Sep 17 00:00:00 2001 From: Stephanie Hingtgen Date: Tue, 28 Jan 2025 19:57:34 -0700 Subject: [PATCH] Search fallback: prevent for now (#99725) --- pkg/registry/apis/dashboard/search_test.go | 5 ++--- pkg/storage/unified/resource/go.mod | 2 +- pkg/storage/unified/resource/search_client.go | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/registry/apis/dashboard/search_test.go b/pkg/registry/apis/dashboard/search_test.go index 23d7ad18278..b48c4a6fdd1 100644 --- a/pkg/registry/apis/dashboard/search_test.go +++ b/pkg/registry/apis/dashboard/search_test.go @@ -7,15 +7,14 @@ import ( "testing" "github.com/grafana/grafana/pkg/apimachinery/identity" - "github.com/grafana/grafana/pkg/apiserver/rest" "github.com/grafana/grafana/pkg/infra/log" "github.com/grafana/grafana/pkg/infra/tracing" "github.com/grafana/grafana/pkg/services/user" - "github.com/grafana/grafana/pkg/setting" "github.com/grafana/grafana/pkg/storage/unified/resource" "google.golang.org/grpc" ) +/* Temporarily disabled search fallback while we add functionality func TestSearchFallback(t *testing.T) { t.Run("should hit legacy search handler on mode 0", func(t *testing.T) { mockClient := &MockClient{} @@ -172,7 +171,7 @@ func TestSearchFallback(t *testing.T) { t.Fatalf("expected Search NOT to be called, but it was") } }) -} +}*/ func TestSearchHandlerFields(t *testing.T) { // Create a mock client diff --git a/pkg/storage/unified/resource/go.mod b/pkg/storage/unified/resource/go.mod index c2b1383e9c9..b70c1800e01 100644 --- a/pkg/storage/unified/resource/go.mod +++ b/pkg/storage/unified/resource/go.mod @@ -17,7 +17,6 @@ require ( github.com/grafana/grafana v11.4.0-00010101000000-000000000000+incompatible github.com/grafana/grafana-plugin-sdk-go v0.263.0 github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250121113133-e747350fee2d - github.com/grafana/grafana/pkg/apiserver v0.0.0-20250121113133-e747350fee2d github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.2.0 github.com/hashicorp/golang-lru/v2 v2.0.7 github.com/prometheus/client_golang v1.20.5 @@ -121,6 +120,7 @@ require ( github.com/grafana/grafana-app-sdk/logging v0.29.0 // indirect github.com/grafana/grafana-aws-sdk v0.31.5 // indirect github.com/grafana/grafana-azure-sdk-go/v2 v2.1.6 // indirect + github.com/grafana/grafana/pkg/apiserver v0.0.0-20250121113133-e747350fee2d // indirect github.com/grafana/otel-profiling-go v0.5.1 // indirect github.com/grafana/pyroscope-go/godeltaprof v0.1.8 // indirect github.com/grafana/sqlds/v4 v4.1.3 // indirect diff --git a/pkg/storage/unified/resource/search_client.go b/pkg/storage/unified/resource/search_client.go index 43e0faa7b1e..2ecbd5ee2bb 100644 --- a/pkg/storage/unified/resource/search_client.go +++ b/pkg/storage/unified/resource/search_client.go @@ -1,12 +1,11 @@ package resource import ( - "github.com/grafana/grafana/pkg/apiserver/rest" "github.com/grafana/grafana/pkg/setting" ) func NewSearchClient(cfg *setting.Cfg, unifiedStorageConfigKey string, unifiedClient ResourceIndexClient, legacyClient ResourceIndexClient) ResourceIndexClient { - config, ok := cfg.UnifiedStorage[unifiedStorageConfigKey] + /*config, ok := cfg.UnifiedStorage[unifiedStorageConfigKey] if !ok { return legacyClient } @@ -16,5 +15,6 @@ func NewSearchClient(cfg *setting.Cfg, unifiedStorageConfigKey string, unifiedCl return legacyClient default: return unifiedClient - } + }*/ + return unifiedClient }