diff --git a/starter/src/main/java/io/javaoperatorsdk/operator/springboot/starter/OperatorAutoConfiguration.java b/starter/src/main/java/io/javaoperatorsdk/operator/springboot/starter/OperatorAutoConfiguration.java index 92e2706..269eb2a 100644 --- a/starter/src/main/java/io/javaoperatorsdk/operator/springboot/starter/OperatorAutoConfiguration.java +++ b/starter/src/main/java/io/javaoperatorsdk/operator/springboot/starter/OperatorAutoConfiguration.java @@ -3,6 +3,7 @@ import java.util.List; import java.util.Optional; import java.util.Set; +import java.util.concurrent.ExecutorService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -25,6 +26,7 @@ import io.javaoperatorsdk.operator.api.config.AbstractConfigurationService; import io.javaoperatorsdk.operator.api.config.RetryConfiguration; import io.javaoperatorsdk.operator.api.config.Utils; +import io.javaoperatorsdk.operator.api.monitoring.Metrics; import io.javaoperatorsdk.operator.api.reconciler.Reconciler; import io.javaoperatorsdk.operator.config.runtime.AnnotationConfiguration; @@ -96,6 +98,18 @@ public Operator operator( return operator; } + @Bean + @ConditionalOnMissingBean(name = "reconciliationExecutorService") + public ExecutorService reconciliationExecutorService() { + return super.getExecutorService(); + } + + @Bean + @ConditionalOnMissingBean(Metrics.class) + public Metrics metrics() { + return super.getMetrics(); + } + private Reconciler processReconciler( Reconciler reconciler, ResourceClassResolver resourceClassResolver) { final var reconcilerPropertiesMap = configuration.getReconcilers(); @@ -162,6 +176,16 @@ public RetryConfiguration getRetryConfiguration() { } } + @Override + public Metrics getMetrics() { + return metrics(); + } + + @Override + public ExecutorService getExecutorService() { + return reconciliationExecutorService(); + } + @Override public int concurrentReconciliationThreads() { return configuration.getConcurrentReconciliationThreads();