mirror of
https://github.com/grafana/grafana.git
synced 2025-08-01 10:17:05 +08:00
unified-storage: Missing rename of index_server to search_server (#107469)
* rename
This commit is contained in:
@ -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()),
|
||||
)
|
||||
|
@ -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
|
||||
|
@ -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(),
|
||||
|
Reference in New Issue
Block a user