Skip to content

Commit 06e5b86

Browse files
committed
fix issue
1 parent 2ecb77b commit 06e5b86

File tree

11 files changed

+27
-42
lines changed

11 files changed

+27
-42
lines changed

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/reload_it/EventReloadConfigMapTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,10 @@ void test(CapturedOutput output) {
154154

155155
// we fail while reading 'configMapOne'
156156
Awaitility.await().atMost(Duration.ofSeconds(10)).pollInterval(Duration.ofSeconds(1)).until(() -> {
157-
boolean one = output.getOut().contains("failure in reading named sources");
158-
boolean two = output.getOut()
159-
.contains("there was an error while reading config maps/secrets, no reload will happen");
157+
boolean one = output.getOut().contains("Failure in reading named sources");
158+
boolean two = output.getOut().contains("Failed to load source");
160159
boolean three = output.getOut()
161-
.contains("reloadable condition was not satisfied, reload will not be triggered");
160+
.contains("Reloadable condition was not satisfied, reload will not be triggered");
162161
boolean updateStrategyNotCalled = !strategyCalled[0];
163162
return one && two && three && updateStrategyNotCalled;
164163
});

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/reload_it/EventReloadSecretTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,10 @@ void test(CapturedOutput output) {
156156

157157
// we fail while reading 'configMapOne'
158158
Awaitility.await().atMost(Duration.ofSeconds(10)).pollInterval(Duration.ofSeconds(1)).until(() -> {
159-
boolean one = output.getOut().contains("failure in reading named sources");
160-
boolean two = output.getOut()
161-
.contains("there was an error while reading config maps/secrets, no reload will happen");
159+
boolean one = output.getOut().contains("Failure in reading named sources");
160+
boolean two = output.getOut().contains("Failed to load source");
162161
boolean three = output.getOut()
163-
.contains("reloadable condition was not satisfied, reload will not be triggered");
162+
.contains("Reloadable condition was not satisfied, reload will not be triggered");
164163
boolean updateStrategyNotCalled = !strategyCalled[0];
165164
return one && two && three && updateStrategyNotCalled;
166165
});

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/reload_it/PollingReloadConfigMapTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,10 @@ static void after() {
136136
void test(CapturedOutput output) {
137137
// we fail while reading 'configMapOne'
138138
Awaitility.await().atMost(Duration.ofSeconds(10)).pollInterval(Duration.ofSeconds(1)).until(() -> {
139-
boolean one = output.getOut().contains("failure in reading named sources");
140-
boolean two = output.getOut()
141-
.contains("there was an error while reading config maps/secrets, no reload will happen");
139+
boolean one = output.getOut().contains("Failure in reading named sources");
140+
boolean two = output.getOut().contains("Failed to load source");
142141
boolean three = output.getOut()
143-
.contains("reloadable condition was not satisfied, reload will not be triggered");
142+
.contains("Reloadable condition was not satisfied, reload will not be triggered");
144143
boolean updateStrategyNotCalled = !strategyCalled[0];
145144
return one && two && three && updateStrategyNotCalled;
146145
});

spring-cloud-kubernetes-client-config/src/test/java/org/springframework/cloud/kubernetes/client/config/reload_it/PollingReloadSecretTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,10 @@ static void after() {
137137
void test(CapturedOutput output) {
138138
// we fail while reading 'secretOne'
139139
Awaitility.await().atMost(Duration.ofSeconds(10)).pollInterval(Duration.ofSeconds(1)).until(() -> {
140-
boolean one = output.getOut().contains("failure in reading named sources");
141-
boolean two = output.getOut()
142-
.contains("there was an error while reading config maps/secrets, no reload will happen");
140+
boolean one = output.getOut().contains("Failure in reading named sources");
141+
boolean two = output.getOut().contains("Failed to load source");
143142
boolean three = output.getOut()
144-
.contains("reloadable condition was not satisfied, reload will not be triggered");
143+
.contains("Reloadable condition was not satisfied, reload will not be triggered");
145144
boolean updateStrategyNotCalled = !strategyCalled[0];
146145
return one && two && three && updateStrategyNotCalled;
147146
});

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public final SourceData compute(Map<String, String> labels, ConfigUtils.Prefix p
7979
}
8080
}
8181
catch (Exception e) {
82-
LOG.warn("failure in reading labeled sources");
82+
LOG.warn("Failure in reading labeled sources");
8383
onException(failFast, e);
8484
data = new MultipleSourcesContainer(data.names(), Map.of(ERROR_PROPERTY, "true"));
8585
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public final SourceData compute(String sourceName, ConfigUtils.Prefix prefix, St
7171

7272
}
7373
catch (Exception e) {
74-
LOG.warn("failure in reading named sources");
74+
LOG.warn("Failure in reading named sources");
7575
onException(failFast, e);
7676
data = new MultipleSourcesContainer(data.names(), Map.of(ERROR_PROPERTY, "true"));
7777
}

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

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
import org.springframework.core.env.PropertySource;
3434
import org.springframework.core.log.LogAccessor;
3535

36-
import static org.springframework.cloud.kubernetes.commons.config.Constants.ERROR_PROPERTY;
37-
3836
/**
3937
* @author wind57
4038
*/
@@ -77,7 +75,7 @@ public static boolean reload(PropertySourceLocator locator, ConfigurableEnvironm
7775
return true;
7876
}
7977
else {
80-
LOG.debug("reloadable condition was not satisfied, reload will not be triggered");
78+
LOG.debug("Reloadable condition was not satisfied, reload will not be triggered");
8179
}
8280

8381
return false;
@@ -165,11 +163,6 @@ else if (propertySource instanceof CompositePropertySource source) {
165163

166164
static boolean changed(List<? extends MapPropertySource> k8sSources, List<? extends MapPropertySource> appSources) {
167165

168-
if (k8sSources.stream().anyMatch(source -> "true".equals(source.getProperty(ERROR_PROPERTY)))) {
169-
LOG.info(() -> "there was an error while reading config maps/secrets, no reload will happen");
170-
return false;
171-
}
172-
173166
if (k8sSources.size() != appSources.size()) {
174167
if (LOG.isDebugEnabled()) {
175168
LOG.debug("k8s property sources size: " + k8sSources.size());

spring-cloud-kubernetes-fabric8-config/src/test/java/org/springframework/cloud/kubernetes/fabric8/config/reload_it/EventReloadConfigMapTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,10 @@ void test(CapturedOutput output) {
114114

115115
// we fail while reading 'configMapTwo'
116116
Awaitility.await().atMost(Duration.ofSeconds(10)).pollInterval(Duration.ofSeconds(1)).until(() -> {
117-
boolean one = output.getOut().contains("failure in reading named sources");
118-
boolean two = output.getOut()
119-
.contains("there was an error while reading config maps/secrets, no reload will happen");
117+
boolean one = output.getOut().contains("Failure in reading named sources");
118+
boolean two = output.getOut().contains("Failed to load source");
120119
boolean three = output.getOut()
121-
.contains("reloadable condition was not satisfied, reload will not be triggered");
120+
.contains("Reloadable condition was not satisfied, reload will not be triggered");
122121
boolean updateStrategyNotCalled = !strategyCalled[0];
123122
return one && two && three && updateStrategyNotCalled;
124123
});

spring-cloud-kubernetes-fabric8-config/src/test/java/org/springframework/cloud/kubernetes/fabric8/config/reload_it/EventReloadSecretTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,10 @@ void test(CapturedOutput output) {
116116

117117
// we fail while reading 'secretTwo'
118118
Awaitility.await().atMost(Duration.ofSeconds(10)).pollInterval(Duration.ofSeconds(1)).until(() -> {
119-
boolean one = output.getOut().contains("failure in reading named sources");
120-
boolean two = output.getOut()
121-
.contains("there was an error while reading config maps/secrets, no reload will happen");
119+
boolean one = output.getOut().contains("Failure in reading named sources");
120+
boolean two = output.getOut().contains("Failed to load source");
122121
boolean three = output.getOut()
123-
.contains("reloadable condition was not satisfied, reload will not be triggered");
122+
.contains("Reloadable condition was not satisfied, reload will not be triggered");
124123
boolean updateStrategyNotCalled = !strategyCalled[0];
125124
return one && two && three && updateStrategyNotCalled;
126125
});

spring-cloud-kubernetes-fabric8-config/src/test/java/org/springframework/cloud/kubernetes/fabric8/config/reload_it/PollingReloadConfigMapTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,10 @@ static void beforeAll() {
109109
void test(CapturedOutput output) {
110110
// we fail while reading 'configMapOne'
111111
Awaitility.await().atMost(Duration.ofSeconds(10)).pollInterval(Duration.ofSeconds(1)).until(() -> {
112-
boolean one = output.getOut().contains("failure in reading named sources");
113-
boolean two = output.getOut()
114-
.contains("there was an error while reading config maps/secrets, no reload will happen");
112+
boolean one = output.getOut().contains("Failure in reading named sources");
113+
boolean two = output.getOut().contains("Failed to load source");
115114
boolean three = output.getOut()
116-
.contains("reloadable condition was not satisfied, reload will not be triggered");
115+
.contains("Reloadable condition was not satisfied, reload will not be triggered");
117116
boolean updateStrategyNotCalled = !strategyCalled[0];
118117
return one && two && three && updateStrategyNotCalled;
119118
});

0 commit comments

Comments
 (0)