Skip to content

Commit 36aeb02

Browse files
committed
return early
1 parent f56026f commit 36aeb02

File tree

1 file changed

+6
-1
lines changed
  • spring-cloud-kubernetes-commons/src/main/java/org/springframework/cloud/kubernetes/commons/config/reload

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,14 @@ public static boolean reload(String target, String sourceAsString, PropertySourc
6060
public static boolean reload(PropertySourceLocator locator, ConfigurableEnvironment environment,
6161
Class<? extends MapPropertySource> existingSourcesType) {
6262

63-
List<? extends MapPropertySource> sourceFromK8s = locateMapPropertySources(locator, environment);
6463
List<? extends MapPropertySource> existingSources = findPropertySources(existingSourcesType, environment);
6564

65+
if (existingSources.isEmpty()) {
66+
LOG.debug(() -> "no existingSources found, reload will not happen");
67+
}
68+
69+
List<? extends MapPropertySource> sourceFromK8s = locateMapPropertySources(locator, environment);
70+
6671
boolean changed = changed(sourceFromK8s, existingSources);
6772
if (changed) {
6873
LOG.info("Detected change in config maps/secrets");

0 commit comments

Comments
 (0)