mirror of https://github.com/grpc/grpc-go.git
interop: add a flag to clients to statically configure grpclb (#4290)
This commit is contained in:
parent
2456c5cff0
commit
4a19753e9d
|
@ -56,6 +56,7 @@ var (
|
||||||
defaultServiceAccount = flag.String("default_service_account", "", "Email of GCE default service account")
|
defaultServiceAccount = flag.String("default_service_account", "", "Email of GCE default service account")
|
||||||
serverHost = flag.String("server_host", "localhost", "The server host name")
|
serverHost = flag.String("server_host", "localhost", "The server host name")
|
||||||
serverPort = flag.Int("server_port", 10000, "The server port number")
|
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.")
|
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",
|
testCase = flag.String("test_case", "large_unary",
|
||||||
`Configure different test cases. Valid options are:
|
`Configure different test cases. Valid options are:
|
||||||
|
@ -187,6 +188,9 @@ func main() {
|
||||||
opts = append(opts, grpc.WithPerRPCCredentials(oauth.NewOauthAccess(interop.GetToken(*serviceAccountKeyFile, *oauthScope))))
|
opts = append(opts, grpc.WithPerRPCCredentials(oauth.NewOauthAccess(interop.GetToken(*serviceAccountKeyFile, *oauthScope))))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(*serviceConfigJSON) > 0 {
|
||||||
|
opts = append(opts, grpc.WithDisableServiceConfig(), grpc.WithDefaultServiceConfig(*serviceConfigJSON))
|
||||||
|
}
|
||||||
opts = append(opts, grpc.WithBlock())
|
opts = append(opts, grpc.WithBlock())
|
||||||
conn, err := grpc.Dial(serverAddr, opts...)
|
conn, err := grpc.Dial(serverAddr, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue