File tree 1 file changed +10
-3
lines changed
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config
1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -24,12 +24,19 @@ default Set<String> getNamespaces() {
24
24
}
25
25
26
26
default boolean watchAllNamespaces () {
27
- return getNamespaces ().isEmpty ();
27
+ return allNamespacesWatched (getNamespaces ());
28
+ }
29
+
30
+ static boolean allNamespacesWatched (Set <String > namespaces ) {
31
+ return namespaces == null || namespaces .isEmpty ();
28
32
}
29
33
30
34
default boolean watchCurrentNamespace () {
31
- final var namespaces = getNamespaces ();
32
- return namespaces .size () == 1 && namespaces .contains (Controller .WATCH_CURRENT_NAMESPACE );
35
+ return currentNamespaceWatched (getNamespaces ());
36
+ }
37
+
38
+ static boolean currentNamespaceWatched (Set <String > namespaces ) {
39
+ return namespaces != null && namespaces .size () == 1 && namespaces .contains (Controller .WATCH_CURRENT_NAMESPACE );
33
40
}
34
41
35
42
default RetryConfiguration getRetryConfiguration () {
You can’t perform that action at this time.
0 commit comments