intel / intel-device-plugins-for-kubernetes

Collection of Intel device plugins for Kubernetes
Apache License 2.0
35 stars 203 forks source link

pkg/deviceplugin: move to grpc.NewClient() #1748

Closed mythi closed 4 months ago

mythi commented 4 months ago

grpc.NewClient(), added in grpc-go v1.63, is the preferred way to create a new ClientConn. In most of our usages, moving away from grpc.Dial*() to it is straightforward.

However, we've also relied on grpc.Dial*()'s behavior to automatically make a new connection to "test" a connection is successful isn't available anymore. Combined with grpc.WithBlock dialoption this usage is considered "especially bad" way to handle a client connection.

The recommended approach to test a server connection is to separately make a connection and watch the connection state to become Ready. This change follows that recommendation.