mirror of https://github.com/grpc/grpc-go.git
[interop client] provide a flag to set google-c2p resolver universe domain (#8145)
* provide a flag on interop_client to set google-c2p resolver universe domai
This commit is contained in:
parent
28128e0b1f
commit
05d49d0147
|
@ -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"
|
||||
)
|
||||
|
@ -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.")
|
||||
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue