From 564b78d32f8075a98a5ffb61fee9963bda40071c Mon Sep 17 00:00:00 2001 From: Matvey Arye Date: Sat, 13 Nov 2021 12:57:31 -0500 Subject: [PATCH] Fixing naming brought up in PR review Also ran `make fmt` --- plugin/storage/grpc/config/config.go | 2 +- plugin/storage/grpc/options.go | 12 ++++++------ plugin/storage/integration/grpc_test.go | 5 ++--- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/plugin/storage/grpc/config/config.go b/plugin/storage/grpc/config/config.go index 416ddb7ca67a..6da971644870 100644 --- a/plugin/storage/grpc/config/config.go +++ b/plugin/storage/grpc/config/config.go @@ -93,7 +93,7 @@ func (c *Configuration) buildRemote(logger *zap.Logger) (*ClientPluginServices, defer cancel() conn, err := grpc.DialContext(ctx, c.RemoteServerAddr, opts...) if err != nil { - return nil, fmt.Errorf("error connecting to Promscale GRPC server: %w", err) + return nil, fmt.Errorf("error connecting to remote storage: %w", err) } grpcClient := shared.NewGRPCClient(conn) diff --git a/plugin/storage/grpc/options.go b/plugin/storage/grpc/options.go index 0f3a9a41a341..5236f954fd60 100644 --- a/plugin/storage/grpc/options.go +++ b/plugin/storage/grpc/options.go @@ -29,8 +29,8 @@ const ( pluginConfigurationFile = "grpc-storage-plugin.configuration-file" pluginLogLevel = "grpc-storage-plugin.log-level" remotePrefix = "grpc-storage" - pluginServer = remotePrefix + ".server" - pluginConnectionTimeout = remotePrefix + ".connection-timeout" + remoteServer = remotePrefix + ".server" + remoteConnectionTimeout = remotePrefix + ".connection-timeout" defaultPluginLogLevel = "warn" defaultConnectionTimeout = time.Duration(5 * time.Second) ) @@ -55,8 +55,8 @@ func (opt *Options) AddFlags(flagSet *flag.FlagSet) { flagSet.String(pluginBinary, "", "The location of the plugin binary") flagSet.String(pluginConfigurationFile, "", "A path pointing to the plugin's configuration file, made available to the plugin with the --config arg") flagSet.String(pluginLogLevel, defaultPluginLogLevel, "Set the log level of the plugin's logger") - flagSet.String(pluginServer, "", "The server address for the remote gRPC server") - flagSet.Duration(pluginConnectionTimeout, defaultConnectionTimeout, "The connection timeout for connecting to the remote server") + flagSet.String(remoteServer, "", "The server address for the remote gRPC server") + flagSet.Duration(remoteConnectionTimeout, defaultConnectionTimeout, "The connection timeout for connecting to the remote server") } @@ -66,7 +66,7 @@ func (opt *Options) InitFromViper(v *viper.Viper) { opt.Configuration.PluginBinary = v.GetString(pluginBinary) opt.Configuration.PluginConfigurationFile = v.GetString(pluginConfigurationFile) opt.Configuration.PluginLogLevel = v.GetString(pluginLogLevel) - opt.Configuration.RemoteServerAddr = v.GetString(pluginServer) + opt.Configuration.RemoteServerAddr = v.GetString(remoteServer) opt.Configuration.RemoteTLS = tlsFlagsConfig.InitFromViper(v) - opt.Configuration.RemoteConnectTimeout = v.GetDuration(pluginConnectionTimeout) + opt.Configuration.RemoteConnectTimeout = v.GetDuration(remoteConnectionTimeout) } diff --git a/plugin/storage/integration/grpc_test.go b/plugin/storage/integration/grpc_test.go index 186078f05a77..6c308b810263 100644 --- a/plugin/storage/integration/grpc_test.go +++ b/plugin/storage/integration/grpc_test.go @@ -23,17 +23,16 @@ import ( "sync" "testing" - "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" - "github.com/jaegertracing/jaeger/plugin/storage/memory" "github.com/stretchr/testify/require" "github.com/uber/jaeger-lib/metrics" "go.uber.org/zap" - googleGRPC "google.golang.org/grpc" "github.com/jaegertracing/jaeger/pkg/config" "github.com/jaegertracing/jaeger/pkg/testutils" "github.com/jaegertracing/jaeger/plugin/storage/grpc" + "github.com/jaegertracing/jaeger/plugin/storage/grpc/shared" + "github.com/jaegertracing/jaeger/plugin/storage/memory" "github.com/jaegertracing/jaeger/storage/dependencystore" "github.com/jaegertracing/jaeger/storage/spanstore" )