mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +00:00
Replace deprecated methods in the logic involved in the construction of gRPC connection to kms-plugin.
This commit is contained in:
parent
3d40c4cea2
commit
e50c264c35
@ -61,12 +61,11 @@ func NewGRPCService(endpoint string, callTimeout time.Duration) (Service, error)
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
connection, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithDefaultCallOptions(grpc.FailFast(false)), grpc.WithDialer(
|
connection, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithDefaultCallOptions(grpc.WaitForReady(true)), grpc.WithContextDialer(
|
||||||
func(string, time.Duration) (net.Conn, error) {
|
func(context.Context, string) (net.Conn, error) {
|
||||||
// Ignoring addr and timeout arguments:
|
// Ignoring addr and timeout arguments:
|
||||||
// addr - comes from the closure
|
// addr - comes from the closure
|
||||||
// timeout - is ignored since we are connecting in a non-blocking configuration
|
c, err := net.DialUnix(unixProtocol, nil, &net.UnixAddr{Name: addr})
|
||||||
c, err := net.DialTimeout(unixProtocol, addr, 0)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Errorf("failed to create connection to unix socket: %s, error: %v", addr, err)
|
klog.Errorf("failed to create connection to unix socket: %s, error: %v", addr, err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user