-
Notifications
You must be signed in to change notification settings - Fork 40.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spring.config.activate.on-cloud-platform should consider NONE to be semantically equivalent to null #38506
Comments
We think this makes sense but we're unsure about when to make the change. It could be considered a bug, in which case 3.1.x would be an option if the risk isn't too great. WDYT, @philwebb? |
I think we should consider this an enhancement. The original intention of the The
In other words, if we're guessing wrong for whatever reason then set this to tell us. There is a subtle distinction between I think it's fine for us to change the |
Closing in favor of #38510 that we'll merge in 3.3. |
Apologies if this has been reported before, couldn't find any StackOverflow posts or GitHub issues.
When attempting to use
spring.config.activate.on-cloud-platform
, there is no mechanism available to simply state "If not running on a cloud platform" without forcibly setting theNONE
value viaspring.main.cloud-platform
through some other mechanism.spring-boot/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigDataProperties.java
Line 128 in 152acf8
This is undesirable for libraries providing configuration files with default values (e.g. through multi-documents) for scenarios when the consumers is running on a cloud platform and for when they aren't, as it forces one of the following scenarios:
spring.main.cloud-platform: NONE
when running locally (ex: through their application-{local-env-name}.yml)spring.config.activate.on-cloud-platform
and multi-document config files, and conditionally load the properties through custom beans and manual CloudPlatform checksspring.config.activate.on-cloud-platform
and use a different, likely more unreliable, property condition, such asspring.config.activate.on-profile: 'DEV | LOCAL | NO-PLATFORM'
Proposed change:
The text was updated successfully, but these errors were encountered: