Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interop: add a flag to clients to statically configure grpclb #4290

Merged
merged 5 commits into from
Mar 26, 2021
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions interop/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ var (
defaultServiceAccount = flag.String("default_service_account", "", "Email of GCE default service account")
serverHost = flag.String("server_host", "localhost", "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:
Expand Down Expand Up @@ -183,6 +184,10 @@ func main() {
opts = append(opts, grpc.WithPerRPCCredentials(oauth.NewOauthAccess(interop.GetToken(*serviceAccountKeyFile, *oauthScope))))
}
}
if len(*serviceConfigJSON) > 0 {
opts = append(opts, grpc.WithDisableServiceConfig())
opts = append(opts, grpc.WithDefaultServiceConfig(*serviceConfigJSON))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1-line:

opts = append(opts, grpc.WithDisableServiceConfig(), grpc.WithDefaultServiceConfig(*serviceConfigJSON))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Thanks for the quick review. If this looks good, can you please merge? I don't have merge permissions on this repo (as noted in other PR)

}
opts = append(opts, grpc.WithBlock())
conn, err := grpc.Dial(serverAddr, opts...)
if err != nil {
Expand Down