File tree 5 files changed +37
-12
lines changed
operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api
smoke-test-samples/pure-java/src/main/java/io/javaoperatorsdk/operator/sample
5 files changed +37
-12
lines changed Original file line number Diff line number Diff line change 1
1
package io .javaoperatorsdk .operator .api .config ;
2
2
3
3
import java .util .Set ;
4
+ import java .util .concurrent .ExecutorService ;
4
5
5
6
import io .fabric8 .kubernetes .api .model .HasMetadata ;
6
7
import io .fabric8 .kubernetes .client .Config ;
@@ -16,6 +17,7 @@ public class ConfigurationServiceOverrider {
16
17
private Cloner cloner ;
17
18
private int timeoutSeconds ;
18
19
private boolean closeClientOnStop ;
20
+ private ExecutorService executorService = null ;
19
21
20
22
public ConfigurationServiceOverrider (
21
23
ConfigurationService original ) {
@@ -65,6 +67,11 @@ public ConfigurationServiceOverrider withCloseClientOnStop(boolean close) {
65
67
return this ;
66
68
}
67
69
70
+ public ConfigurationServiceOverrider withExecutorService (ExecutorService executorService ) {
71
+ this .executorService = executorService ;
72
+ return this ;
73
+ }
74
+
68
75
public ConfigurationService build () {
69
76
return new ConfigurationService () {
70
77
@ Override
@@ -120,6 +127,15 @@ public Metrics getMetrics() {
120
127
public boolean closeClientOnStop () {
121
128
return closeClientOnStop ;
122
129
}
130
+
131
+ @ Override
132
+ public ExecutorService getExecutorService () {
133
+ if (executorService != null ) {
134
+ return executorService ;
135
+ } else {
136
+ return ConfigurationService .super .getExecutorService ();
137
+ }
138
+ }
123
139
};
124
140
}
125
141
Original file line number Diff line number Diff line change @@ -34,15 +34,17 @@ default RetryConfiguration getRetryConfiguration() {
34
34
}
35
35
36
36
default boolean useFinalizer () {
37
- return !Constants .NO_FINALIZER
38
- .equals (getFinalizer ());
37
+ return !Constants .NO_FINALIZER .equals (getFinalizer ());
39
38
}
40
39
41
40
/**
42
- * Allow controllers to filter events before they are provided to the
43
- * {@link io.javaoperatorsdk.operator.processing.event.EventHandler}. Note that the provided
44
- * filter is combined with {@link #isGenerationAware()} to compute the final set of filters that
45
- * should be applied;
41
+ * Allow controllers to filter events before they are passed to the
42
+ * {@link io.javaoperatorsdk.operator.processing.event.EventHandler}.
43
+ *
44
+ * <p>
45
+ * Resource event filters only applies on events of the main custom resource. Not on events from
46
+ * other event sources nor the periodic events.
47
+ * </p>
46
48
*
47
49
* @return filter
48
50
*/
Original file line number Diff line number Diff line change 50
50
String labelSelector () default Constants .EMPTY_STRING ;
51
51
52
52
/**
53
- * Optional list of classes providing custom {@link ResourceEventFilter}.
53
+ * <p>
54
+ * Resource event filters only applies on events of the main custom resource. Not on events from
55
+ * other event sources nor the periodic events.
56
+ * </p>
54
57
*
55
58
* @return the list of event filters.
56
59
*/
Original file line number Diff line number Diff line change 44
44
45
45
<junit .version>5.8.2</junit .version>
46
46
<fabric8-client .version>5.12.0</fabric8-client .version>
47
- <slf4j .version>1.7.35 </slf4j .version>
48
- <log4j .version>2.17.1 </log4j .version>
47
+ <slf4j .version>1.7.36 </slf4j .version>
48
+ <log4j .version>2.17.2 </log4j .version>
49
49
<mokito .version>4.3.1</mokito .version>
50
50
<commons-lang3 .version>3.12.0</commons-lang3 .version>
51
51
<auto-service .version>1.0.1</auto-service .version>
Original file line number Diff line number Diff line change 1
1
package io .javaoperatorsdk .operator .sample ;
2
2
3
+ import java .util .concurrent .Executors ;
4
+
3
5
import io .javaoperatorsdk .operator .Operator ;
4
6
import io .javaoperatorsdk .operator .api .config .ConfigurationServiceOverrider ;
5
7
import io .javaoperatorsdk .operator .config .runtime .DefaultConfigurationService ;
@@ -8,9 +10,11 @@ public class PureJavaApplicationRunner {
8
10
9
11
public static void main (String [] args ) {
10
12
Operator operator =
11
- new Operator (ConfigurationServiceOverrider .override (DefaultConfigurationService .instance ())
12
- .withConcurrentReconciliationThreads (2 )
13
- .build ());
13
+ new Operator (
14
+ ConfigurationServiceOverrider .override (DefaultConfigurationService .instance ())
15
+ .withExecutorService (Executors .newCachedThreadPool ())
16
+ .withConcurrentReconciliationThreads (2 )
17
+ .build ());
14
18
operator .register (new CustomServiceReconciler ());
15
19
operator .start ();
16
20
}
You can’t perform that action at this time.
0 commit comments