4
4
import java .util .Optional ;
5
5
import java .util .Set ;
6
6
7
+ import org .slf4j .Logger ;
8
+ import org .slf4j .LoggerFactory ;
9
+
7
10
import io .fabric8 .kubernetes .api .model .GenericKubernetesResource ;
8
11
import io .fabric8 .kubernetes .client .utils .Serialization ;
9
12
import io .javaoperatorsdk .operator .api .reconciler .Context ;
@@ -24,6 +27,8 @@ public class GenericDependentResource
24
27
Updater <GenericKubernetesResource , Glue >,
25
28
Creator <GenericKubernetesResource , Glue > {
26
29
30
+ private static final Logger log = LoggerFactory .getLogger (GenericDependentResource .class );
31
+
27
32
protected final GenericKubernetesResource desired ;
28
33
protected final String desiredTemplate ;
29
34
protected final String name ;
@@ -104,7 +109,15 @@ protected Optional<GenericKubernetesResource> selectTargetSecondaryResource(
104
109
Glue primary ,
105
110
Context <Glue > context ) {
106
111
107
- var res = context .getSecondaryResources (GenericKubernetesResource .class )
112
+ var allSecondaryResources = context .getSecondaryResources (GenericKubernetesResource .class );
113
+ if (log .isDebugEnabled ()) {
114
+ log .debug ("All secondary resources for DR: {}, resources: {}" , name ,
115
+ allSecondaryResources .stream ()
116
+ .map (r -> "{ Name: %s; Namespace: %s }" .formatted (r .getMetadata ().getName (),
117
+ r .getMetadata ().getNamespace ()))
118
+ .toList ());
119
+ }
120
+ var res = allSecondaryResources
108
121
.stream ()
109
122
.filter (r -> r .getKind ().equals (getGroupVersionKind ().getKind ()) &&
110
123
r .getApiVersion ().equals (getGroupVersionKind ().apiVersion ()) &&
0 commit comments