From d7a0ebb4712f69d62a12ec90d160a0c478328d7c Mon Sep 17 00:00:00 2001 From: dhurley Date: Tue, 10 Oct 2023 10:26:30 +0100 Subject: [PATCH] Fix user agent request header to have the correct agent version --- src/core/grpc.go | 2 +- .../vendor/github.com/nginx/agent/v2/src/core/grpc.go | 2 +- .../vendor/github.com/nginx/agent/v2/src/core/grpc.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/grpc.go b/src/core/grpc.go index 0d22474f7..33d77457a 100644 --- a/src/core/grpc.go +++ b/src/core/grpc.go @@ -68,7 +68,7 @@ func CreateGrpcClients(ctx context.Context, loadedConfig *config.Config) (client } func setDialOptions(loadedConfig *config.Config) []grpc.DialOption { - grpcDialOptions := []grpc.DialOption{grpc.WithUserAgent("nginx-agent/" + strings.TrimPrefix(version, "v"))} + grpcDialOptions := []grpc.DialOption{grpc.WithUserAgent("nginx-agent/" + strings.TrimPrefix(loadedConfig.Version, "v"))} grpcDialOptions = append(grpcDialOptions, sdkGRPC.DefaultClientDialOptions...) grpcDialOptions = append(grpcDialOptions, sdkGRPC.DataplaneConnectionDialOptions(loadedConfig.Server.Token, sdkGRPC.NewMessageMeta(uuid.NewString()))...) return grpcDialOptions diff --git a/test/integration/vendor/github.com/nginx/agent/v2/src/core/grpc.go b/test/integration/vendor/github.com/nginx/agent/v2/src/core/grpc.go index 0d22474f7..33d77457a 100644 --- a/test/integration/vendor/github.com/nginx/agent/v2/src/core/grpc.go +++ b/test/integration/vendor/github.com/nginx/agent/v2/src/core/grpc.go @@ -68,7 +68,7 @@ func CreateGrpcClients(ctx context.Context, loadedConfig *config.Config) (client } func setDialOptions(loadedConfig *config.Config) []grpc.DialOption { - grpcDialOptions := []grpc.DialOption{grpc.WithUserAgent("nginx-agent/" + strings.TrimPrefix(version, "v"))} + grpcDialOptions := []grpc.DialOption{grpc.WithUserAgent("nginx-agent/" + strings.TrimPrefix(loadedConfig.Version, "v"))} grpcDialOptions = append(grpcDialOptions, sdkGRPC.DefaultClientDialOptions...) grpcDialOptions = append(grpcDialOptions, sdkGRPC.DataplaneConnectionDialOptions(loadedConfig.Server.Token, sdkGRPC.NewMessageMeta(uuid.NewString()))...) return grpcDialOptions diff --git a/test/performance/vendor/github.com/nginx/agent/v2/src/core/grpc.go b/test/performance/vendor/github.com/nginx/agent/v2/src/core/grpc.go index 0d22474f7..33d77457a 100644 --- a/test/performance/vendor/github.com/nginx/agent/v2/src/core/grpc.go +++ b/test/performance/vendor/github.com/nginx/agent/v2/src/core/grpc.go @@ -68,7 +68,7 @@ func CreateGrpcClients(ctx context.Context, loadedConfig *config.Config) (client } func setDialOptions(loadedConfig *config.Config) []grpc.DialOption { - grpcDialOptions := []grpc.DialOption{grpc.WithUserAgent("nginx-agent/" + strings.TrimPrefix(version, "v"))} + grpcDialOptions := []grpc.DialOption{grpc.WithUserAgent("nginx-agent/" + strings.TrimPrefix(loadedConfig.Version, "v"))} grpcDialOptions = append(grpcDialOptions, sdkGRPC.DefaultClientDialOptions...) grpcDialOptions = append(grpcDialOptions, sdkGRPC.DataplaneConnectionDialOptions(loadedConfig.Server.Token, sdkGRPC.NewMessageMeta(uuid.NewString()))...) return grpcDialOptions