From d68c755b586014874fb809d9db2c4f2435e44962 Mon Sep 17 00:00:00 2001 From: Alexander Polcyn Date: Wed, 24 Mar 2021 17:51:02 -0700 Subject: [PATCH] add service config json interop flag --- interop/client/client.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/interop/client/client.go b/interop/client/client.go index 7961752b6f91..18a34dff9678 100644 --- a/interop/client/client.go +++ b/interop/client/client.go @@ -54,6 +54,7 @@ var ( defaultServiceAccount = flag.String("default_service_account", "", "Email of GCE default service account") serverHost = flag.String("server_host", "127.0.0.1", "The server host name") serverPort = flag.Int("server_port", 10000, "The server port number") + serviceConfigJson = flag.String("service_config_json", "", "Disables service config lookups and sets the provided string as the default service config.") tlsServerName = flag.String("server_host_override", "", "The server name use to verify the hostname returned by TLS handshake if it is not empty. Otherwise, --server_host is used.") testCase = flag.String("test_case", "large_unary", `Configure different test cases. Valid options are: @@ -120,6 +121,10 @@ func main() { } else { opts = append(opts, grpc.WithInsecure()) } + if len(*serviceConfigJson) > 0 { + opts = append(opts, grpc.WithDisableServiceConfig()) + opts = append(opts, grpc.WithDefaultServiceConfig(*serviceConfigJson)) + } conn, err := grpc.Dial(serverAddr, opts...) if err != nil { grpclog.Fatalf("Fail to dial: %v", err)