From fe7ca61a5141745d3904174d00dac9cf64ba0fc7 Mon Sep 17 00:00:00 2001 From: Will Assis <35489495+gassiss@users.noreply.github.com> Date: Tue, 1 Jul 2025 14:35:46 -0400 Subject: [PATCH] unified-storage: Missing rename of index_server to search_server (#107469) * rename --- pkg/services/apiserver/options/storage.go | 6 +++--- pkg/storage/unified/client.go | 16 ++++++++-------- pkg/storage/unified/client_test.go | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pkg/services/apiserver/options/storage.go b/pkg/services/apiserver/options/storage.go index cddc8bb3c61..d6c700303b6 100644 --- a/pkg/services/apiserver/options/storage.go +++ b/pkg/services/apiserver/options/storage.go @@ -43,7 +43,7 @@ type StorageOptions struct { // For unified-grpc Address string - IndexServerAddress string + SearchServerAddress string GrpcClientAuthenticationToken string GrpcClientAuthenticationTokenExchangeURL string GrpcClientAuthenticationTokenNamespace string @@ -138,8 +138,8 @@ func (o *StorageOptions) ApplyTo(serverConfig *genericapiserver.RecommendedConfi return err } var indexConn *grpc.ClientConn - if o.IndexServerAddress != "" { - indexConn, err = grpc.NewClient(o.IndexServerAddress, + if o.SearchServerAddress != "" { + indexConn, err = grpc.NewClient(o.SearchServerAddress, grpc.WithStatsHandler(otelgrpc.NewClientHandler()), grpc.WithTransportCredentials(insecure.NewCredentials()), ) diff --git a/pkg/storage/unified/client.go b/pkg/storage/unified/client.go index 53942a903bf..635f134825c 100644 --- a/pkg/storage/unified/client.go +++ b/pkg/storage/unified/client.go @@ -58,12 +58,12 @@ func ProvideUnifiedStorageClient(opts *Options, // See: apiserver.applyAPIServerConfig(cfg, features, o) apiserverCfg := opts.Cfg.SectionWithEnvOverrides("grafana-apiserver") client, err := newClient(options.StorageOptions{ - StorageType: options.StorageType(apiserverCfg.Key("storage_type").MustString(string(options.StorageTypeUnified))), - DataPath: apiserverCfg.Key("storage_path").MustString(filepath.Join(opts.Cfg.DataPath, "grafana-apiserver")), - Address: apiserverCfg.Key("address").MustString(""), - IndexServerAddress: apiserverCfg.Key("index_server_address").MustString(""), - BlobStoreURL: apiserverCfg.Key("blob_url").MustString(""), - BlobThresholdBytes: apiserverCfg.Key("blob_threshold_bytes").MustInt(options.BlobThresholdDefault), + StorageType: options.StorageType(apiserverCfg.Key("storage_type").MustString(string(options.StorageTypeUnified))), + DataPath: apiserverCfg.Key("storage_path").MustString(filepath.Join(opts.Cfg.DataPath, "grafana-apiserver")), + Address: apiserverCfg.Key("address").MustString(""), + SearchServerAddress: apiserverCfg.Key("search_server_address").MustString(""), + BlobStoreURL: apiserverCfg.Key("blob_url").MustString(""), + BlobThresholdBytes: apiserverCfg.Key("blob_threshold_bytes").MustInt(options.BlobThresholdDefault), }, opts.Cfg, opts.Features, opts.DB, opts.Tracer, opts.Reg, opts.Authzc, opts.Docs, storageMetrics, indexMetrics) if err == nil { // Used to get the folder stats @@ -135,8 +135,8 @@ func newClient(opts options.StorageOptions, return nil, err } - if opts.IndexServerAddress != "" { - indexConn, err = newGrpcConn(opts.IndexServerAddress, metrics, features) + if opts.SearchServerAddress != "" { + indexConn, err = newGrpcConn(opts.SearchServerAddress, metrics, features) if err != nil { return nil, err diff --git a/pkg/storage/unified/client_test.go b/pkg/storage/unified/client_test.go index b75c22442a6..3169786ba64 100644 --- a/pkg/storage/unified/client_test.go +++ b/pkg/storage/unified/client_test.go @@ -65,9 +65,9 @@ func TestUnifiedStorageClient(t *testing.T) { client, err := newClient( options.StorageOptions{ - StorageType: options.StorageTypeUnifiedGrpc, - Address: resourceServerAddress, - IndexServerAddress: indexServerAddress, + StorageType: options.StorageTypeUnifiedGrpc, + Address: resourceServerAddress, + SearchServerAddress: indexServerAddress, }, &setting.Cfg{}, featuremgmt.WithFeatures(),