File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config Expand file tree Collapse file tree 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() {
2424 }
2525
2626 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 ();
2832 }
2933
3034 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 );
3340 }
3441
3542 default RetryConfiguration getRetryConfiguration () {
You can’t perform that action at this time.
0 commit comments