diff options
author | yihuaz <yihuaz@google.com> | 2018-05-10 12:52:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-10 12:52:15 -0700 |
commit | 173a29d82e3235d9b988f8e6da823ca6df806e21 (patch) | |
tree | 04f9cff6a8db4eaf2602927bf3390ea0269ea429 | |
parent | 5c372a62b8ddc37b5e40c0281cb90076d466dae6 (diff) | |
parent | 3549fd74ae46690a90341a295352055c15bdc29d (diff) |
Merge pull request #15325 from yihuazhang/google_default_creds_fix
Fix channel args errors in google default credentials
-rw-r--r-- | src/core/lib/security/credentials/google_default/google_default_credentials.cc | 14 |
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; } |