Skip to content

Commit 977a8cc

Browse files
authored
Deprecate config paths (#1336)
1 parent 944c7d7 commit 977a8cc

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

docs/src/main/asciidoc/property-source-config.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,8 @@ Kubernetes service accounts, roles and role bindings.
581581

582582
Another option for using `ConfigMap` instances is to mount them into the Pod by running the Spring Cloud Kubernetes application
583583
and having Spring Cloud Kubernetes read them from the file system.
584+
585+
NOTE: This feature is deprecated and will be removed in a future release (Use `spring.config.import` instead).
584586
This behavior is controlled by the `spring.cloud.kubernetes.config.paths` property. You can use it in
585587
addition to or instead of the mechanism described earlier.
586588
`spring.cloud.kubernetes.config.paths` expects a List of full paths to each property file, because directories are not being recursively parsed. For example:

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public Collection<PropertySource<?>> locateCollection(Environment environment) {
9999

100100
private void addPropertySourcesFromPaths(Environment environment, CompositePropertySource composite) {
101101
Set<String> uniquePaths = new LinkedHashSet<>(properties.paths());
102+
LOG.warn("path support is deprecated and will be removed in a future release. Please use spring.config.import");
102103
LOG.debug("paths property sources : " + uniquePaths);
103104
uniquePaths.stream().map(Paths::get).filter(p -> {
104105
boolean exists = Files.exists(p);

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ protected abstract SecretsPropertySource getPropertySource(ConfigurableEnvironme
112112

113113
protected void putPathConfig(CompositePropertySource composite) {
114114

115+
LOG.warn("path support is deprecated and will be removed in a future release. Please use spring.config.import");
116+
115117
this.properties.paths().stream().map(Paths::get).filter(Files::exists).flatMap(x -> {
116118
try {
117119
return Files.walk(x);

0 commit comments

Comments
 (0)