Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
feat: add google-c2p dependence to DirectPath
Browse files Browse the repository at this point in the history
  • Loading branch information
mohanli-ml committed Oct 15, 2021
1 parent 119b6d1 commit ce1227a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,12 @@ private ManagedChannel createSingleChannel() throws IOException, GeneralSecurity

ManagedChannelBuilder<?> builder;

// TODO(weiranf): Add API in ComputeEngineCredentials to check default service account.
String directPathXdsEnv = envProvider.getenv(DIRECT_PATH_ENABLE_XDS);
boolean isDirectPathXdsEnabled = Boolean.parseBoolean(directPathXdsEnv);
// Check DirectPath traffic.
boolean isDirectPathXdsEnabled = false;
if (isDirectPathEnabled(serviceAddress)
&& isNonDefaultServiceAccountAllowed()
&& isOnComputeEngine()) {
isDirectPathXdsEnabled = Boolean.parseBoolean(envProvider.getenv(DIRECT_PATH_ENABLE_XDS));
if (isDirectPathXdsEnabled) {
// google-c2p resolver target must not have a port number
builder = ComputeEngineChannelBuilder.forTarget("google-c2p:///" + serviceAddress);
Expand Down

0 comments on commit ce1227a

Please sign in to comment.