Skip to content

Commit

Permalink
Make Istio client compatible with grpc 1.42+
Browse files Browse the repository at this point in the history
Context: grpc/grpc-go#4894

I have tested this works with grpc 1.41 and 1.42.
  • Loading branch information
howardjohn committed Oct 21, 2021
1 parent ed9f7fe commit cd14b9b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions apis/istio/v1/client.go
Expand Up @@ -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
}

Expand Down

0 comments on commit cd14b9b

Please sign in to comment.