Skip to content

Commit 5ff0687

Browse files
authored
fix issue (#1386)
1 parent 963096c commit 5ff0687

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ 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");
102+
if (!uniquePaths.isEmpty()) {
103+
LOG.warn(
104+
"path support is deprecated and will be removed in a future release. Please use spring.config.import");
105+
}
103106
LOG.debug("paths property sources : " + uniquePaths);
104107
uniquePaths.stream().map(Paths::get).filter(p -> {
105108
boolean exists = Files.exists(p);

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,10 @@ 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");
115+
if (!properties.paths().isEmpty()) {
116+
LOG.warn(
117+
"path support is deprecated and will be removed in a future release. Please use spring.config.import");
118+
}
116119

117120
this.properties.paths().stream().map(Paths::get).filter(Files::exists).flatMap(x -> {
118121
try {

0 commit comments

Comments
 (0)