systemPropertiesOverride -> overrideSystemProperties
This commit is contained in:
@@ -101,7 +101,7 @@ public class PropertySourceBootstrapConfiguration implements
|
||||
new RelaxedDataBinder(remoteProperties, "spring.cloud.config").bind(new PropertySourcesPropertyValues(
|
||||
incoming));
|
||||
if (!remoteProperties.isAllowOverride()
|
||||
|| remoteProperties.isSystemPropertiesOverride()) {
|
||||
|| remoteProperties.isOverrideSystemProperties()) {
|
||||
propertySources.addFirst(composite);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public class PropertySourceBootstrapProperties {
|
||||
* Flag to indicate that the external properties should override system properties.
|
||||
* Default true.
|
||||
*/
|
||||
private boolean systemPropertiesOverride = true;
|
||||
private boolean overrideSystemProperties = true;
|
||||
|
||||
/**
|
||||
* Flag to indicate that {@link #isSystemPropertiesOverride()
|
||||
@@ -18,12 +18,12 @@ public class PropertySourceBootstrapProperties {
|
||||
*/
|
||||
private boolean allowOverride = true;
|
||||
|
||||
public boolean isSystemPropertiesOverride() {
|
||||
return systemPropertiesOverride;
|
||||
public boolean isOverrideSystemProperties() {
|
||||
return overrideSystemProperties;
|
||||
}
|
||||
|
||||
public void setSystemPropertiesOverride(boolean systemPropertiesOverride) {
|
||||
this.systemPropertiesOverride = systemPropertiesOverride;
|
||||
public void setOverrideSystemProperties(boolean overrideSystemProperties) {
|
||||
this.overrideSystemProperties = overrideSystemProperties;
|
||||
}
|
||||
|
||||
public boolean isAllowOverride() {
|
||||
|
||||
@@ -122,7 +122,7 @@ public class BootstrapConfigurationTests {
|
||||
public void systemPropertyOverrideFalse() {
|
||||
PropertySourceConfiguration.MAP.put("bootstrap.foo", "bar");
|
||||
PropertySourceConfiguration.MAP.put(
|
||||
"spring.cloud.config.systemPropertiesOverride", "false");
|
||||
"spring.cloud.config.overrideSystemProperties", "false");
|
||||
System.setProperty("bootstrap.foo", "system");
|
||||
context = new SpringApplicationBuilder().web(false)
|
||||
.sources(BareConfiguration.class).run();
|
||||
@@ -133,7 +133,7 @@ public class BootstrapConfigurationTests {
|
||||
public void systemPropertyOverrideWhenOverrideDisallowed() {
|
||||
PropertySourceConfiguration.MAP.put("bootstrap.foo", "bar");
|
||||
PropertySourceConfiguration.MAP.put(
|
||||
"spring.cloud.config.systemPropertiesOverride", "false");
|
||||
"spring.cloud.config.overrideSystemProperties", "false");
|
||||
// If spring.cloud.config.allowOverride=false is in the remote property sources
|
||||
// with sufficiently high priority it always wins. Admins can enforce it by adding
|
||||
// their own remote property source.
|
||||
|
||||
Reference in New Issue
Block a user