Skip to content

Commit 2e339ec

Browse files
committed
fixes unit-test CI failure
1 parent c5d7d3a commit 2e339ec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring/src/main/java/io/kubernetes/client/spring/extended/controller/KubernetesReconcilerProcessor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private Map<Class, AddFilterAdaptor> getAddFilters(
120120
for (KubernetesReconcilerWatch watch : watches.value()) {
121121
for (Method method : reconciler.getClass().getMethods()) {
122122
AddWatchEventFilter annotation = method.getAnnotation(AddWatchEventFilter.class);
123-
if (watch.apiTypeClass().equals(annotation.apiTypeClass())) {
123+
if (annotation != null && watch.apiTypeClass().equals(annotation.apiTypeClass())) {
124124
if (filters.containsKey(watch.apiTypeClass())) {
125125
log.warn(
126126
"Duplicated watch ADD event filter upon apiType {}", annotation.apiTypeClass());
@@ -146,7 +146,7 @@ private Map<Class, UpdateFilterAdaptor> getUpdateFilters(
146146
for (KubernetesReconcilerWatch watch : watches.value()) {
147147
for (Method method : reconciler.getClass().getMethods()) {
148148
UpdateWatchEventFilter annotation = method.getAnnotation(UpdateWatchEventFilter.class);
149-
if (watch.apiTypeClass().equals(annotation.apiTypeClass())) {
149+
if (annotation != null && watch.apiTypeClass().equals(annotation.apiTypeClass())) {
150150
if (filters.containsKey(watch.apiTypeClass())) {
151151
log.warn(
152152
"Duplicated watch UPDATE event filter upon apiType {}", annotation.apiTypeClass());
@@ -173,7 +173,7 @@ private Map<Class, DeleteFilterAdaptor> getDeleteFilters(
173173
for (KubernetesReconcilerWatch watch : watches.value()) {
174174
for (Method method : reconciler.getClass().getMethods()) {
175175
DeleteWatchEventFilter annotation = method.getAnnotation(DeleteWatchEventFilter.class);
176-
if (watch.apiTypeClass().equals(annotation.apiTypeClass())) {
176+
if (annotation != null && watch.apiTypeClass().equals(annotation.apiTypeClass())) {
177177
if (filters.containsKey(watch.apiTypeClass())) {
178178
log.warn(
179179
"Duplicated watch DELETE event filter upon apiType {}", annotation.apiTypeClass());

0 commit comments

Comments
 (0)