From 5035dae3d5b2750b49872ed0288748850a1b657b Mon Sep 17 00:00:00 2001 From: immutablet Date: Mon, 7 Oct 2019 15:57:47 -0700 Subject: [PATCH] Replace deprecated methods in the logic involved in the construction of gRPC connection to kms-plugin. Kubernetes-commit: e50c264c35a32200febde3b10838b2ef2f986c39 --- pkg/storage/value/encrypt/envelope/grpc_service.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/storage/value/encrypt/envelope/grpc_service.go b/pkg/storage/value/encrypt/envelope/grpc_service.go index 818da7dec..eae05a7b6 100644 --- a/pkg/storage/value/encrypt/envelope/grpc_service.go +++ b/pkg/storage/value/encrypt/envelope/grpc_service.go @@ -61,12 +61,11 @@ func NewGRPCService(endpoint string, callTimeout time.Duration) (Service, error) return nil, err } - connection, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithDefaultCallOptions(grpc.FailFast(false)), grpc.WithDialer( - func(string, time.Duration) (net.Conn, error) { + connection, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithDefaultCallOptions(grpc.WaitForReady(true)), grpc.WithContextDialer( + func(context.Context, string) (net.Conn, error) { // Ignoring addr and timeout arguments: // addr - comes from the closure - // timeout - is ignored since we are connecting in a non-blocking configuration - c, err := net.DialTimeout(unixProtocol, addr, 0) + c, err := net.DialUnix(unixProtocol, nil, &net.UnixAddr{Name: addr}) if err != nil { klog.Errorf("failed to create connection to unix socket: %s, error: %v", addr, err) }