Skip to content

Commit 392fc19

Browse files
committed
cleanup
Signed-off-by: wind57 <[email protected]>
1 parent 45632f6 commit 392fc19

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,8 @@ public PropertySource<?> locate(Environment environment) {
8484
LOG.debug("Config Map normalized sources : " + sources);
8585
sources.forEach(s -> {
8686
MapPropertySource propertySource = getMapPropertySource(s, env);
87-
if (propertySource.getPropertyNames().length == 0) {
88-
LOG.debug("Skipping empty config map property source source " + propertySource.getName());
89-
}
90-
else {
91-
LOG.debug("Adding config map property source " + propertySource.getName());
92-
composite.addPropertySource(propertySource);
93-
}
87+
LOG.debug("Adding config map property source " + propertySource.getName());
88+
composite.addPropertySource(propertySource);
9489
});
9590
}
9691

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public final SourceData compute(String sourceName, ConfigUtils.Prefix prefix, St
4242
// first comes non-profile based source
4343
sourceNames.add(sourceName);
4444

45-
MultipleSourcesContainer data;
45+
MultipleSourcesContainer data = MultipleSourcesContainer.empty();;
4646

4747
try {
4848
if (profileSources) {
@@ -70,7 +70,6 @@ public final SourceData compute(String sourceName, ConfigUtils.Prefix prefix, St
7070
}
7171
catch (Exception e) {
7272
onException(failFast, e);
73-
return SourceData.emptyRecord("generated-on-failure");
7473
}
7574

7675
String names = data.names().stream().sorted().collect(Collectors.joining(PROPERTY_SOURCE_NAME_SEPARATOR));

0 commit comments

Comments
 (0)