Skip to content

Commit

Permalink
replace deprecated method grpc.DialContext in favour of grpc.NewClient
Browse files Browse the repository at this point in the history
Signed-off-by: Tariq Ibrahim <tibrahim@nvidia.com>
  • Loading branch information
tariq1890 committed Nov 20, 2024
1 parent b97b763 commit 1cae921
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/dcgmexporter/kubernetes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1cae921

Please sign in to comment.