From cd14b9b20ad5e49f78dfb5b9a2475b4b18a055d8 Mon Sep 17 00:00:00 2001 From: John Howard Date: Thu, 21 Oct 2021 10:14:25 -0700 Subject: [PATCH] Make Istio client compatible with grpc 1.42+ Context: https://github.com/grpc/grpc-go/issues/4894 I have tested this works with grpc 1.41 and 1.42. --- apis/istio/v1/client.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/apis/istio/v1/client.go b/apis/istio/v1/client.go index df5290fa..5cb11f69 100644 --- a/apis/istio/v1/client.go +++ b/apis/istio/v1/client.go @@ -43,15 +43,12 @@ func GetClientTCP(host string, port int64, timeout time.Duration) (ctx context.C c = NewKeyManagementServiceClient(conn) return } + func GetClientSocket(socket string, timeout time.Duration) (ctx context.Context, cancel context.CancelFunc, c KeyManagementServiceClient, err error) { // Get Client options := []grpc.DialOption{grpc.WithInsecure()} var conn *grpc.ClientConn - u := &url.URL{ - Scheme: "unix", - Path: socket, - } - if conn, err = grpc.Dial(u.String(), options...); err != nil { + if conn, err = grpc.Dial("unix:"+socket, options...); err != nil { return }