Merge pull request #14731 from ramil600/grpc_withinsecure

client/v3: replace deprecated grpc.WithInsecure()  issue #14732
This commit is contained in:
Benjamin Wang 2022-11-16 06:41:29 +08:00 committed by GitHub
commit bf5c936ff1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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