xds: enable PSM security by default (#8478)

This commit is contained in:
sanjaypujare 2021-09-03 12:38:26 -07:00 committed by GitHub
parent a91cc85dfd
commit 4828698bec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View File

@ -69,7 +69,8 @@ final class ClusterImplLoadBalancer extends LoadBalancer {
|| Boolean.parseBoolean(System.getenv("GRPC_XDS_EXPERIMENTAL_CIRCUIT_BREAKING"));
@VisibleForTesting
static boolean enableSecurity =
Boolean.parseBoolean(System.getenv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT"));
Strings.isNullOrEmpty(System.getenv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT"))
|| Boolean.parseBoolean(System.getenv("GRPC_XDS_EXPERIMENTAL_SECURITY_SUPPORT"));
private static final Attributes.Key<ClusterLocalityStats> ATTR_CLUSTER_LOCALITY_STATS =
Attributes.Key.create("io.grpc.xds.ClusterImplLoadBalancer.clusterLocalityStats");

View File

@ -480,16 +480,16 @@ public class ClusterImplLoadBalancerTest {
}
@Test
public void endpointAddressesAttachedWithTlsConfig_enableSecurity() {
public void endpointAddressesAttachedWithTlsConfig_disableSecurity() {
boolean originalEnableSecurity = ClusterImplLoadBalancer.enableSecurity;
ClusterImplLoadBalancer.enableSecurity = true;
subtest_endpointAddressesAttachedWithTlsConfig(true);
ClusterImplLoadBalancer.enableSecurity = false;
subtest_endpointAddressesAttachedWithTlsConfig(false);
ClusterImplLoadBalancer.enableSecurity = originalEnableSecurity;
}
@Test
public void endpointAddressesAttachedWithTlsConfig_securityDisabledByDefault() {
subtest_endpointAddressesAttachedWithTlsConfig(false);
public void endpointAddressesAttachedWithTlsConfig_securityEnabledByDefault() {
subtest_endpointAddressesAttachedWithTlsConfig(true);
}
private void subtest_endpointAddressesAttachedWithTlsConfig(boolean enableSecurity) {