Skip to content

Commit 3608c15

Browse files
committed
Merge branch 'main' into next
# Conflicts: # operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java # pom.xml
2 parents 0bd71d5 + cd50a73 commit 3608c15

File tree

5 files changed

+37
-12
lines changed

5 files changed

+37
-12
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ConfigurationServiceOverrider.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.javaoperatorsdk.operator.api.config;
22

33
import java.util.Set;
4+
import java.util.concurrent.ExecutorService;
45

56
import io.fabric8.kubernetes.api.model.HasMetadata;
67
import io.fabric8.kubernetes.client.Config;
@@ -16,6 +17,7 @@ public class ConfigurationServiceOverrider {
1617
private Cloner cloner;
1718
private int timeoutSeconds;
1819
private boolean closeClientOnStop;
20+
private ExecutorService executorService = null;
1921

2022
public ConfigurationServiceOverrider(
2123
ConfigurationService original) {
@@ -65,6 +67,11 @@ public ConfigurationServiceOverrider withCloseClientOnStop(boolean close) {
6567
return this;
6668
}
6769

70+
public ConfigurationServiceOverrider withExecutorService(ExecutorService executorService) {
71+
this.executorService = executorService;
72+
return this;
73+
}
74+
6875
public ConfigurationService build() {
6976
return new ConfigurationService() {
7077
@Override
@@ -120,6 +127,15 @@ public Metrics getMetrics() {
120127
public boolean closeClientOnStop() {
121128
return closeClientOnStop;
122129
}
130+
131+
@Override
132+
public ExecutorService getExecutorService() {
133+
if (executorService != null) {
134+
return executorService;
135+
} else {
136+
return ConfigurationService.super.getExecutorService();
137+
}
138+
}
123139
};
124140
}
125141

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@ default RetryConfiguration getRetryConfiguration() {
3434
}
3535

3636
default boolean useFinalizer() {
37-
return !Constants.NO_FINALIZER
38-
.equals(getFinalizer());
37+
return !Constants.NO_FINALIZER.equals(getFinalizer());
3938
}
4039

4140
/**
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>
4648
*
4749
* @return filter
4850
*/

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ControllerConfiguration.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@
5050
String labelSelector() default Constants.EMPTY_STRING;
5151

5252
/**
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>
5457
*
5558
* @return the list of event filters.
5659
*/

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444

4545
<junit.version>5.8.2</junit.version>
4646
<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>
4949
<mokito.version>4.3.1</mokito.version>
5050
<commons-lang3.version>3.12.0</commons-lang3.version>
5151
<auto-service.version>1.0.1</auto-service.version>

smoke-test-samples/pure-java/src/main/java/io/javaoperatorsdk/operator/sample/PureJavaApplicationRunner.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package io.javaoperatorsdk.operator.sample;
22

3+
import java.util.concurrent.Executors;
4+
35
import io.javaoperatorsdk.operator.Operator;
46
import io.javaoperatorsdk.operator.api.config.ConfigurationServiceOverrider;
57
import io.javaoperatorsdk.operator.config.runtime.DefaultConfigurationService;
@@ -8,9 +10,11 @@ public class PureJavaApplicationRunner {
810

911
public static void main(String[] args) {
1012
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());
1418
operator.register(new CustomServiceReconciler());
1519
operator.start();
1620
}

0 commit comments

Comments
 (0)