Skip to content

Commit 459d14d

Browse files
committed
added documentation
Signed-off-by: wind57 <[email protected]>
1 parent 4da318c commit 459d14d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/CustomYamlPropertiesFactoryBean.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,20 @@
4949
* {@link org.springframework.beans.factory.config.YamlPropertiesFactoryBean} that takes
5050
* care to override profile-based collections and maps.
5151
*
52+
* Unlike YamlPropertiesFactoryBean, which flattens collections and maps, this one does things a bit different.
53+
*
54+
* <ul>
55+
* <li>read all the documents in a yaml file</li>
56+
* <li>flatten all properties besides collection and maps,
57+
* YamlPropertiesFactoryBean does not do that and starts flattening everything</li>
58+
* <li>take only those that match the document matchers</li>
59+
* <li>split them in two : those that have profile activation and those that don't</li>
60+
* <li>override properties in the non-profile based yamls with the ones from profile based ones.
61+
* This achieves the same result as a plain spring-boot app, where profile based properties have a higher
62+
* precedence.</li>
63+
* <li>once the overriding happened, we do another flattening, this time including collection and maps</li>
64+
* </ul>
65+
*
5266
* @author wind57
5367
*/
5468
final class CustomYamlPropertiesFactoryBean {

0 commit comments

Comments
 (0)