Merge branch '2.0.x' into main

This commit is contained in:
Ryan Baxter
2021-08-12 07:20:43 -04:00

View File

@@ -20,8 +20,9 @@ import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.LinkedHashSet;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -67,7 +68,7 @@ public abstract class ConfigMapPropertySourceLocator implements PropertySourceLo
CompositePropertySource composite = new CompositePropertySource("composite-configmap");
if (this.properties.isEnableApi()) {
List<NormalizedSource> sources = this.properties.determineSources();
Set<NormalizedSource> sources = new LinkedHashSet<>(this.properties.determineSources());
LOG.debug("Config Map normalized sources : " + sources);
sources.forEach(s -> composite.addFirstPropertySource(getMapPropertySourceForSingleConfigMap(env, s)));
}
@@ -88,7 +89,8 @@ public abstract class ConfigMapPropertySourceLocator implements PropertySourceLo
}
private void addPropertySourcesFromPaths(Environment environment, CompositePropertySource composite) {
properties.getPaths().stream().map(Paths::get).filter(p -> {
Set<String> uniquePaths = new LinkedHashSet<>(properties.getPaths());
uniquePaths.stream().map(Paths::get).filter(p -> {
boolean exists = Files.exists(p);
if (!exists) {
LOG.warn("Configured input path: " + p