-
Notifications
You must be signed in to change notification settings - Fork 40.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent indirect standard profile-specific imports
Update `StandardConfigDataLocationResolver` so that profile-specific imports can only be used when there is no parent import. Prior to this commit, given the following application.properties file: spring.profiles.active=p1,p2 spring.config.import=other.properties We would attempt to import `other.properties`, `other-p1.properties` and `other-p2.properties`. This seems quite confusing and when we really only need to support profile-specific properties for the initial root set of locations. Fixes gh-26752
- Loading branch information
Showing
13 changed files
with
33 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...esources/application-import-with-profile-variant-and-direct-profile-import-dev.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
spring.config.import=classpath:application-import-with-profile-variant-imported-dev.properties | ||
my.value=notimported-dev | ||
my.value=application-import-with-profile-variant-and-direct-profile-import-dev |
2 changes: 1 addition & 1 deletion
2
...st/resources/application-import-with-profile-variant-and-direct-profile-import.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
spring.config.import=classpath:application-import-with-profile-variant-imported.properties | ||
my.value=notimported | ||
my.value=application-import-with-profile-variant-and-direct-profile-import |
2 changes: 1 addition & 1 deletion
2
...ect/spring-boot/src/test/resources/application-import-with-profile-variant-dev.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
my.value=notimported-dev | ||
my.value=application-import-with-profile-variant-dev |
2 changes: 1 addition & 1 deletion
2
...g-boot/src/test/resources/application-import-with-profile-variant-imported-dev.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
my.value=iwasimported-dev | ||
my.value=application-import-with-profile-variant-imported-dev |
2 changes: 1 addition & 1 deletion
2
...pring-boot/src/test/resources/application-import-with-profile-variant-imported.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
my.value=iwasimported | ||
my.value=application-import-with-profile-variant-imported |
2 changes: 1 addition & 1 deletion
2
...project/spring-boot/src/test/resources/application-import-with-profile-variant.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
spring.config.import=classpath:application-import-with-profile-variant-imported.properties | ||
my.value=notimported | ||
my.value=application-import-with-profile-variant |
1 change: 1 addition & 0 deletions
1
...t/src/test/resources/application-profile-specific-import-with-import-import-p1.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
application-profile-specific-import-with-import-import-p1=true |
1 change: 1 addition & 0 deletions
1
...t/src/test/resources/application-profile-specific-import-with-import-import-p2.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
application-profile-specific-import-with-import-import-p2=true |
1 change: 1 addition & 0 deletions
1
...boot/src/test/resources/application-profile-specific-import-with-import-import.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
application-profile-specific-import-with-import-import=true |
2 changes: 2 additions & 0 deletions
2
...ing-boot/src/test/resources/application-profile-specific-import-with-import-p1.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
application-profile-specific-import-with-import-p1=true | ||
spring.config.import=application-profile-specific-import-with-import-import.properties |
2 changes: 2 additions & 0 deletions
2
...spring-boot/src/test/resources/application-profile-specific-import-with-import.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
spring.profiles.active=p1,p2 | ||
application-profile-specific-import-with-import=true |