diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java
index 1dca3a6bc7..d9bac430a7 100644
--- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java
+++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ControllerConfiguration.java
@@ -13,7 +13,6 @@
import io.javaoperatorsdk.operator.processing.event.rate.LinearRateLimiter;
import io.javaoperatorsdk.operator.processing.event.rate.RateLimiter;
import io.javaoperatorsdk.operator.processing.retry.GenericRetry;
-import io.javaoperatorsdk.operator.processing.retry.GradualRetry;
import io.javaoperatorsdk.operator.processing.retry.Retry;
public interface ControllerConfiguration
extends ResourceConfiguration
{
@@ -58,22 +57,7 @@ default boolean isGenerationAware() {
String getAssociatedReconcilerClassName();
default Retry getRetry() {
- final var configuration = getRetryConfiguration();
- return !RetryConfiguration.DEFAULT.equals(configuration)
- ? GenericRetry.fromConfiguration(configuration)
- : GenericRetry.DEFAULT; // NOSONAR
- }
-
- /**
- * Use {@link #getRetry()} instead.
- *
- * @return configuration for retry.
- * @deprecated provide your own {@link Retry} implementation or use the {@link GradualRetry}
- * annotation instead
- */
- @Deprecated(forRemoval = true)
- default RetryConfiguration getRetryConfiguration() {
- return RetryConfiguration.DEFAULT;
+ return GenericRetry.DEFAULT;
}
@SuppressWarnings("rawtypes")
diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/DefaultRetryConfiguration.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/DefaultRetryConfiguration.java
deleted file mode 100644
index 40fbb38aa7..0000000000
--- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/DefaultRetryConfiguration.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package io.javaoperatorsdk.operator.api.config;
-
-public class DefaultRetryConfiguration implements RetryConfiguration {
-
-}
diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/RetryConfiguration.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/RetryConfiguration.java
deleted file mode 100644
index b293c7e33f..0000000000
--- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/RetryConfiguration.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package io.javaoperatorsdk.operator.api.config;
-
-import io.javaoperatorsdk.operator.processing.retry.GradualRetry;
-
-/**
- * @deprecated specify your own {@link io.javaoperatorsdk.operator.processing.retry.Retry}
- * implementation or use {@link GradualRetry} annotation instead
- */
-@Deprecated(forRemoval = true)
-public interface RetryConfiguration {
-
- RetryConfiguration DEFAULT = new DefaultRetryConfiguration();
-
- int DEFAULT_MAX_ATTEMPTS = 5;
- long DEFAULT_INITIAL_INTERVAL = 2000L;
- double DEFAULT_MULTIPLIER = 1.5D;
-
- default int getMaxAttempts() {
- return DEFAULT_MAX_ATTEMPTS;
- }
-
- default long getInitialInterval() {
- return DEFAULT_INITIAL_INTERVAL;
- }
-
- default double getIntervalMultiplier() {
- return DEFAULT_MULTIPLIER;
- }
-
- default long getMaxInterval() {
- return (long) (DEFAULT_INITIAL_INTERVAL * Math.pow(DEFAULT_MULTIPLIER, DEFAULT_MAX_ATTEMPTS));
- }
-}
diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java
index 9d5a83dc51..d1809de566 100644
--- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java
+++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/retry/GenericRetry.java
@@ -1,7 +1,6 @@
package io.javaoperatorsdk.operator.processing.retry;
import io.javaoperatorsdk.operator.api.config.AnnotationConfigurable;
-import io.javaoperatorsdk.operator.api.config.RetryConfiguration;
public class GenericRetry implements Retry, AnnotationConfigurable {
private int maxAttempts = GradualRetry.DEFAULT_MAX_ATTEMPTS;
@@ -19,23 +18,6 @@ public static GenericRetry noRetry() {
return new GenericRetry().setMaxAttempts(0);
}
- /**
- * @deprecated Use the {@link GradualRetry} annotation instead
- *
- * @param configuration retry config
- * @return Retry instance
- */
- @Deprecated(forRemoval = true)
- public static Retry fromConfiguration(RetryConfiguration configuration) {
- return configuration == null ? defaultLimitedExponentialRetry()
- : new GenericRetry()
- .setInitialInterval(configuration.getInitialInterval())
- .setMaxAttempts(configuration.getMaxAttempts())
- .setIntervalMultiplier(configuration.getIntervalMultiplier())
- .setMaxInterval(configuration.getMaxInterval());
- }
-
-
public static GenericRetry every10second10TimesRetry() {
return new GenericRetry().withLinearRetry().setMaxAttempts(10).setInitialInterval(10000);
}
diff --git a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/EventProcessorTest.java b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/EventProcessorTest.java
index 9d538713c1..c52a976b86 100644
--- a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/EventProcessorTest.java
+++ b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/EventProcessorTest.java
@@ -18,7 +18,6 @@
import io.javaoperatorsdk.operator.api.config.BaseConfigurationService;
import io.javaoperatorsdk.operator.api.config.ConfigurationService;
import io.javaoperatorsdk.operator.api.config.ControllerConfiguration;
-import io.javaoperatorsdk.operator.api.config.RetryConfiguration;
import io.javaoperatorsdk.operator.api.monitoring.Metrics;
import io.javaoperatorsdk.operator.processing.event.rate.LinearRateLimiter;
import io.javaoperatorsdk.operator.processing.event.rate.RateLimiter;
@@ -28,6 +27,7 @@
import io.javaoperatorsdk.operator.processing.event.source.controller.ResourceEvent;
import io.javaoperatorsdk.operator.processing.event.source.timer.TimerEventSource;
import io.javaoperatorsdk.operator.processing.retry.GenericRetry;
+import io.javaoperatorsdk.operator.processing.retry.GradualRetry;
import io.javaoperatorsdk.operator.processing.retry.Retry;
import io.javaoperatorsdk.operator.processing.retry.RetryExecution;
import io.javaoperatorsdk.operator.sample.simple.TestCustomResource;
@@ -135,7 +135,7 @@ void schedulesAnEventRetryOnException() {
verify(retryTimerEventSourceMock, times(1))
.scheduleOnce(eq(ResourceID.fromResource(customResource)),
- eq(RetryConfiguration.DEFAULT_INITIAL_INTERVAL));
+ eq(GradualRetry.DEFAULT_INITIAL_INTERVAL));
}
@Test
@@ -167,7 +167,7 @@ void executesTheControllerInstantlyAfterErrorIfNewEventsReceived() {
assertThat(allValues).hasSize(2);
verify(retryTimerEventSourceMock, never())
.scheduleOnce(eq(ResourceID.fromResource(customResource)),
- eq(RetryConfiguration.DEFAULT_INITIAL_INTERVAL));
+ eq(GradualRetry.DEFAULT_INITIAL_INTERVAL));
}
@Test
diff --git a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/retry/GenericRetryExecutionTest.java b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/retry/GenericRetryExecutionTest.java
index 1dcd9df464..1659995877 100644
--- a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/retry/GenericRetryExecutionTest.java
+++ b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/retry/GenericRetryExecutionTest.java
@@ -4,38 +4,10 @@
import org.junit.jupiter.api.Test;
-import io.javaoperatorsdk.operator.api.config.RetryConfiguration;
-
import static org.assertj.core.api.Assertions.assertThat;
public class GenericRetryExecutionTest {
- @Test
- public void forFirstBackOffAlwaysReturnsInitialInterval() {
- assertThat(getDefaultRetryExecution().nextDelay().get())
- .isEqualTo(RetryConfiguration.DEFAULT_INITIAL_INTERVAL);
- }
-
- @Test
- public void delayIsMultipliedEveryNextDelayCall() {
- RetryExecution retryExecution = getDefaultRetryExecution();
-
- Optional res = callNextDelayNTimes(retryExecution, 1);
- assertThat(res.get()).isEqualTo(RetryConfiguration.DEFAULT_INITIAL_INTERVAL);
-
- res = retryExecution.nextDelay();
- assertThat(res.get())
- .isEqualTo((long) (RetryConfiguration.DEFAULT_INITIAL_INTERVAL
- * RetryConfiguration.DEFAULT_MULTIPLIER));
-
- res = retryExecution.nextDelay();
- assertThat(res.get())
- .isEqualTo(
- (long) (RetryConfiguration.DEFAULT_INITIAL_INTERVAL
- * RetryConfiguration.DEFAULT_MULTIPLIER
- * RetryConfiguration.DEFAULT_MULTIPLIER));
- }
-
@Test
public void noNextDelayIfMaxAttemptLimitReached() {
RetryExecution retryExecution =