mirror of https://github.com/grpc/grpc-java.git
xds: enable PSM security by default (#8478)
This commit is contained in:
parent
a91cc85dfd
commit
4828698bec
|
|
@ -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");
|
||||
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue