Merge pull request #16791 from chaochn47/remove-deprecated-gRPC-API

remove deprecated gRPC API usage
This commit is contained in:
Benjamin Wang 2023-10-18 11:13:09 +01:00 committed by GitHub
commit d8c410ff82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,7 @@ import (
"github.com/stretchr/testify/assert"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
testpb "google.golang.org/grpc/interop/grpc_testing"
"go.etcd.io/etcd/client/v3/naming/endpoints"
@ -75,7 +76,7 @@ func testEtcdGrpcResolver(t *testing.T, lbPolicy string) {
}
// Create connection with provided lb policy
conn, err := grpc.Dial("etcd:///foo", grpc.WithInsecure(), grpc.WithResolvers(b),
conn, err := grpc.Dial("etcd:///foo", grpc.WithTransportCredentials(insecure.NewCredentials()), grpc.WithResolvers(b),
grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"loadBalancingPolicy":"%s"}`, lbPolicy)))
if err != nil {
t.Fatal("failed to connect to foo", err)