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 client] provide a flag to set google-c2p resolver universe domain #8145

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all 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
12 changes: 9 additions & 3 deletions interop/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ import (
"google.golang.org/grpc/resolver"
"google.golang.org/grpc/testdata"

_ "google.golang.org/grpc/balancer/grpclb" // Register the grpclb load balancing policy.
_ "google.golang.org/grpc/balancer/rls" // Register the RLS load balancing policy.
_ "google.golang.org/grpc/xds/googledirectpath" // Register xDS resolver required for c2p directpath.
_ "google.golang.org/grpc/balancer/grpclb" // Register the grpclb load balancing policy.
_ "google.golang.org/grpc/balancer/rls" // Register the RLS load balancing policy.
"google.golang.org/grpc/xds/googledirectpath" // Register xDS resolver required for c2p directpath.

testgrpc "google.golang.org/grpc/interop/grpc_testing"
)
Expand All @@ -70,6 +70,7 @@ var (
serviceAccountKeyFile = flag.String("service_account_key_file", "", "Path to service account json key file")
oauthScope = flag.String("oauth_scope", "", "The scope for OAuth2 tokens")
defaultServiceAccount = flag.String("default_service_account", "", "Email of GCE default service account")
googleC2PUniverseDomain = flag.String("google_c2p_universe_domain", "", "Universe domain for google-c2p resolve")
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.")
Expand Down Expand Up @@ -201,6 +202,11 @@ func main() {
}

resolver.SetDefaultScheme("dns")
if len(*googleC2PUniverseDomain) > 0 {
if err := googledirectpath.SetUniverseDomain(*googleC2PUniverseDomain); err != nil {
log.Fatalf("googlec2p.SetUniverseDomain(%s) failed: %v", *googleC2PUniverseDomain, err)
}
}
serverAddr := *serverHost
if *serverPort != 0 {
serverAddr = net.JoinHostPort(*serverHost, strconv.Itoa(*serverPort))
Expand Down