client/v3: replace deprecated grpc.WithInsecure()

Deprecated: use WithTransportCredentials and insecure.NewCredentials() instead. Will be supported throughout 1.x.

Signed-off-by: Ramil Mirhasanov <ramil600@yahoo.com>
This commit is contained in:
Ramil Mirhasanov 2022-11-11 12:08:50 +03:00
parent 2f558ca0db
commit 44d8e732cf

View File

@ -32,6 +32,7 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/codes" "google.golang.org/grpc/codes"
grpccredentials "google.golang.org/grpc/credentials" grpccredentials "google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/keepalive" "google.golang.org/grpc/keepalive"
"google.golang.org/grpc/status" "google.golang.org/grpc/status"
) )
@ -231,7 +232,7 @@ func (c *Client) dialSetupOpts(creds grpccredentials.TransportCredentials, dopts
if creds != nil { if creds != nil {
opts = append(opts, grpc.WithTransportCredentials(creds)) opts = append(opts, grpc.WithTransportCredentials(creds))
} else { } else {
opts = append(opts, grpc.WithInsecure()) opts = append(opts, grpc.WithTransportCredentials(insecure.NewCredentials()))
} }
// Interceptor retry and backoff. // Interceptor retry and backoff.