Skip to content

Commit

Permalink
Migrate from legacy gRPC call
Browse files Browse the repository at this point in the history
  • Loading branch information
ptodev committed Jul 16, 2024
1 parent 6053545 commit 56d7f2f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion static/metrics/cluster/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func New(cfg Config, addr string) (ScrapingServiceClient, error) {
return nil, err
}
opts = append(opts, grpcDialOpts...)
conn, err := grpc.Dial(addr, opts...)
conn, err := grpc.NewClient(addr, opts...)
if err != nil {
return nil, err
}
Expand Down
6 changes: 3 additions & 3 deletions static/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestServer(t *testing.T) {

// Validate gRPC
creds := grpc.WithTransportCredentials(insecure.NewCredentials())
cc, err := grpc.Dial(srv.GRPCAddress().String(), creds)
cc, err := grpc.NewClient(srv.GRPCAddress().String(), creds)
require.NoError(t, err)
_, err = grpc_health_v1.NewHealthClient(cc).Check(context.Background(), &grpc_health_v1.HealthCheckRequest{})
require.NoError(t, err)
Expand All @@ -55,7 +55,7 @@ func TestServer_InMemory(t *testing.T) {
grpcDialer := grpc.WithContextDialer(func(ctx context.Context, s string) (net.Conn, error) {
return srv.DialContext(ctx, "", s)
})
cc, err := grpc.Dial(flags.GRPC.InMemoryAddr, grpc.WithTransportCredentials(insecure.NewCredentials()), grpcDialer)
cc, err := grpc.NewClient(flags.GRPC.InMemoryAddr, grpc.WithTransportCredentials(insecure.NewCredentials()), grpcDialer)
require.NoError(t, err)
_, err = grpc_health_v1.NewHealthClient(cc).Check(context.Background(), &grpc_health_v1.HealthCheckRequest{})
require.NoError(t, err)
Expand Down Expand Up @@ -124,7 +124,7 @@ func TestServer_TLS(t *testing.T) {

// Validate gRPC TLS
creds := credentials.NewTLS(&tls.Config{InsecureSkipVerify: true})
cc, err := grpc.Dial(srv.GRPCAddress().String(), grpc.WithTransportCredentials(creds))
cc, err := grpc.NewClient(srv.GRPCAddress().String(), grpc.WithTransportCredentials(creds))
require.NoError(t, err)
_, err = grpc_health_v1.NewHealthClient(cc).Check(context.Background(), &grpc_health_v1.HealthCheckRequest{})
require.NoError(t, err)
Expand Down

0 comments on commit 56d7f2f

Please sign in to comment.