File tree 3 files changed +7
-7
lines changed
operator-framework-core/src
main/java/io/javaoperatorsdk/operator
test/java/io/javaoperatorsdk/operator/processing
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -137,9 +137,7 @@ public <R extends CustomResource> void register(
137
137
}
138
138
139
139
final var client = k8sClient .customResources (resClass );
140
- EventDispatcher dispatcher =
141
- new EventDispatcher (
142
- controller , finalizer , new EventDispatcher .CustomResourceFacade (client ));
140
+ EventDispatcher dispatcher = new EventDispatcher (controller , finalizer , client );
143
141
144
142
CustomResourceCache customResourceCache = new CustomResourceCache (objectMapper );
145
143
DefaultEventHandler defaultEventHandler =
Original file line number Diff line number Diff line change @@ -30,13 +30,17 @@ public class EventDispatcher {
30
30
private final CustomResourceFacade customResourceFacade ;
31
31
private EventSourceManager eventSourceManager ;
32
32
33
- public EventDispatcher (
33
+ EventDispatcher (
34
34
ResourceController controller , String finalizer , CustomResourceFacade customResourceFacade ) {
35
35
this .controller = controller ;
36
36
this .customResourceFacade = customResourceFacade ;
37
37
this .resourceFinalizer = finalizer ;
38
38
}
39
39
40
+ public EventDispatcher (ResourceController controller , String finalizer , MixedOperation client ) {
41
+ this (controller , finalizer , new CustomResourceFacade (client ));
42
+ }
43
+
40
44
public void setEventSourceManager (EventSourceManager eventSourceManager ) {
41
45
this .eventSourceManager = eventSourceManager ;
42
46
}
@@ -174,7 +178,7 @@ private CustomResource replace(CustomResource resource) {
174
178
}
175
179
176
180
// created to support unit testing
177
- public static class CustomResourceFacade <R extends CustomResource > {
181
+ static class CustomResourceFacade <R extends CustomResource > {
178
182
179
183
private final MixedOperation <R , KubernetesResourceList <R >, Resource <R >> resourceOperation ;
180
184
Original file line number Diff line number Diff line change 19
19
import io .javaoperatorsdk .operator .api .ResourceController ;
20
20
import io .javaoperatorsdk .operator .api .RetryInfo ;
21
21
import io .javaoperatorsdk .operator .api .UpdateControl ;
22
- import io .javaoperatorsdk .operator .processing .EventDispatcher ;
23
- import io .javaoperatorsdk .operator .processing .ExecutionScope ;
24
22
import io .javaoperatorsdk .operator .processing .event .Event ;
25
23
import io .javaoperatorsdk .operator .processing .event .internal .CustomResourceEvent ;
26
24
import java .util .ArrayList ;
You can’t perform that action at this time.
0 commit comments