aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Yihua Zhang <yihuaz@google.com>2018-05-09 16:17:20 -0700
committerGravatar Yihua Zhang <yihuaz@google.com>2018-05-09 16:17:20 -0700
commit3549fd74ae46690a90341a295352055c15bdc29d (patch)
tree80e4e5f893f643a18754e1441a1b14bd022768bf /src
parentb6f0477e3642d57251eb59967fd5dbe0fecb7a45 (diff)
fix google default creds
Diffstat (limited to 'src')
-rw-r--r--src/core/lib/security/credentials/google_default/google_default_credentials.cc14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/core/lib/security/credentials/google_default/google_default_credentials.cc b/src/core/lib/security/credentials/google_default/google_default_credentials.cc
index 4b267afe3f..03e8cb3b40 100644
--- a/src/core/lib/security/credentials/google_default/google_default_credentials.cc
+++ b/src/core/lib/security/credentials/google_default/google_default_credentials.cc
@@ -96,12 +96,14 @@ static grpc_security_status google_default_create_security_connector(
* args. By doing that, it guarantees the connections to backends will not be
* torn down and re-connected when switching in and out of fallback mode.
*/
- static const char* args_to_remove[] = {
- GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER,
- GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER,
- };
- *new_args = grpc_channel_args_copy_and_add_and_remove(
- args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), nullptr, 0);
+ if (use_alts) {
+ static const char* args_to_remove[] = {
+ GRPC_ARG_ADDRESS_IS_GRPCLB_LOAD_BALANCER,
+ GRPC_ARG_ADDRESS_IS_BACKEND_FROM_GRPCLB_LOAD_BALANCER,
+ };
+ *new_args = grpc_channel_args_copy_and_add_and_remove(
+ args, args_to_remove, GPR_ARRAY_SIZE(args_to_remove), nullptr, 0);
+ }
return status;
}