From 1cae921123d3af3e80d7add29a60f278e90a0438 Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Mon, 18 Nov 2024 08:39:46 -0800 Subject: [PATCH] replace deprecated method grpc.DialContext in favour of grpc.NewClient Signed-off-by: Tariq Ibrahim --- pkg/dcgmexporter/kubernetes.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/dcgmexporter/kubernetes.go b/pkg/dcgmexporter/kubernetes.go index 8fb8d7d2..a07c2e49 100644 --- a/pkg/dcgmexporter/kubernetes.go +++ b/pkg/dcgmexporter/kubernetes.go @@ -105,13 +105,9 @@ func (p *PodMapper) Process(metrics MetricsByCounter, sysInfo SystemInfo) error } func connectToServer(socket string) (*grpc.ClientConn, func(), error) { - ctx, cancel := context.WithTimeout(context.Background(), connectionTimeout) - defer cancel() - - conn, err := grpc.DialContext(ctx, + conn, err := grpc.NewClient( socket, grpc.WithTransportCredentials(insecure.NewCredentials()), - grpc.WithBlock(), grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) { d := net.Dialer{} return d.DialContext(ctx, "unix", addr)