Allow C2P resolver's server_uri to be overridden for testing (#25551)

* Allow C2P resolver's server_uri to be overridden for testing
pull/25577/head
apolcyn 4 years ago committed by GitHub
parent 223652d408
commit 8ed9680583
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/core/ext/filters/client_channel/resolver/google_c2p/google_c2p_resolver.cc

@ -308,11 +308,18 @@ void GoogleCloud2ProdResolver::StartXdsResolver() {
{"TRAFFICDIRECTOR_DIRECTPATH_C2P_IPV6_CAPABLE", true},
};
}
// Allow the TD server uri to be overridden for testing purposes.
UniquePtr<char> override_server(
gpr_getenv("GRPC_TEST_ONLY_GOOGLE_C2P_RESOLVER_TRAFFIC_DIRECTOR_URI"));
const char* server_uri =
override_server != nullptr && strlen(override_server.get()) > 0
? override_server.get()
: "directpath-trafficdirector.googleapis.com";
Json bootstrap = Json::Object{
{"xds_servers",
Json::Array{
Json::Object{
{"server_uri", "directpath-trafficdirector.googleapis.com"},
{"server_uri", server_uri},
{"channel_creds",
Json::Array{
Json::Object{

Loading…
Cancel
Save