Improve documentation for `override` remote property behaviour
Summary
The documentation of the properties used to control remote property overriding is missing key information and appears to contain conflicting statements. It is quite confusing.
To clarify, I'm specifically referring to the Overriding the Values of Remote Properties section of the documentation.
The properties:
-
spring.cloud.config.allowOverride -
spring.cloud.config.overrideNone -
spring.cloud.config.overrideSystemProperties
Specific details
1. overrideNone (and possibly overrideSystemProperties) must be set remotely
The docs state the following:
If you want to allow your applications to override the remote properties with their own System properties or config files, the remote property source has to grant it permission by setting spring.cloud.config.allowOverride=true (it doesn’t work to set this locally). Once that flag is set there are some finer grained settings to control the location...
☝️ This implies that once devs set the allowOverride = true remotely, overrideNone and overrideSystemProperties can be set locally. I only know that this is not the case due to the discussion in Issue spring-cloud/spring-cloud-config#573.
2. The affect of setting allowOverride to true or false is unclear
Does it enable / disable both of the other properties (overrideNone & overrideSystemProperties)?
The Appendix: Compendium of Configuration Properties describes allowOverride as follows:
Flag to indicate that {@link #isSystemPropertiesOverride() systemPropertiesOverride} can be used. Set to false to prevent users from changing the default accidentally. Default true.
☝️ That seems clear - it enables overrideSystemProperties and does not affect overrideNone. But confusingly the description of overrideNone references this property:
Flag to indicate that when {@link #setAllowOverride(boolean) allowOverride} is true, external properties should take lowest priority, and not override any existing property sources (including local config files). Default false.
... and the description of overrideSystemProperties does not:
Flag to indicate that the external properties should override system properties. Default true.
I'm happy to raise a PR to address this if that helps? I just need a bit of clarity on the open questions.
spring-cloud/spring-cloud-config#573 is an edge case of embedding config server in an app.
PRs welcome
Hi @OlgaMaciaszek, I can't seem to find the documentation associated with this issue. Can you help me find it? I would love to contribute here.