Skip to content

Commit 588731a

Browse files
committed
removes spammy warning message from reconciler processor
1 parent 18671ba commit 588731a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

spring/src/main/java/io/kubernetes/client/spring/extended/controller/factory/KubernetesControllerFactory.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ private Map<Class, AddFilterAdaptor> getAddFilters(
131131
for (KubernetesReconcilerWatch watch : watches.value()) {
132132
for (Method method : reconciler.getClass().getMethods()) {
133133
AddWatchEventFilter annotation = method.getAnnotation(AddWatchEventFilter.class);
134-
if (annotation != null && watch.apiTypeClass().equals(annotation.apiTypeClass())) {
134+
if (annotation == null) {
135+
continue;
136+
}
137+
if (watch.apiTypeClass().equals(annotation.apiTypeClass())) {
135138
if (filters.containsKey(watch.apiTypeClass())) {
136139
log.warn(
137140
"Duplicated watch ADD event filter upon apiType {}", annotation.apiTypeClass());
@@ -157,7 +160,10 @@ private Map<Class, UpdateFilterAdaptor> getUpdateFilters(
157160
for (KubernetesReconcilerWatch watch : watches.value()) {
158161
for (Method method : reconciler.getClass().getMethods()) {
159162
UpdateWatchEventFilter annotation = method.getAnnotation(UpdateWatchEventFilter.class);
160-
if (annotation != null && watch.apiTypeClass().equals(annotation.apiTypeClass())) {
163+
if (annotation == null) {
164+
continue;
165+
}
166+
if (watch.apiTypeClass().equals(annotation.apiTypeClass())) {
161167
if (filters.containsKey(watch.apiTypeClass())) {
162168
log.warn(
163169
"Duplicated watch UPDATE event filter upon apiType {}", annotation.apiTypeClass());
@@ -184,7 +190,10 @@ private Map<Class, DeleteFilterAdaptor> getDeleteFilters(
184190
for (KubernetesReconcilerWatch watch : watches.value()) {
185191
for (Method method : reconciler.getClass().getMethods()) {
186192
DeleteWatchEventFilter annotation = method.getAnnotation(DeleteWatchEventFilter.class);
187-
if (annotation != null && watch.apiTypeClass().equals(annotation.apiTypeClass())) {
193+
if (annotation == null) {
194+
continue;
195+
}
196+
if (watch.apiTypeClass().equals(annotation.apiTypeClass())) {
188197
if (filters.containsKey(watch.apiTypeClass())) {
189198
log.warn(
190199
"Duplicated watch DELETE event filter upon apiType {}", annotation.apiTypeClass());

0 commit comments

Comments
 (0)