From c1f2db7988f36091a7576cdef9dacf221b57d978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20M=C3=A9sz=C3=A1ros?= Date: Mon, 17 Jun 2024 11:14:39 +0200 Subject: [PATCH] improve: remove ErrorStatusHandler interface (#2438) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Attila Mészáros --- .../en/docs/migration/v5-0-migration.md | 3 +- .../api/reconciler/ErrorStatusHandler.java | 28 ------- .../reconciler/ErrorStatusUpdateControl.java | 21 +++++ .../operator/api/reconciler/Reconciler.java | 24 ++++++ .../event/ReconciliationDispatcher.java | 82 ++++++++----------- .../event/ReconciliationDispatcherTest.java | 42 +++++----- .../DependentResourceCrossRefReconciler.java | 3 +- .../ErrorStatusHandlerTestReconciler.java | 3 +- ...endentGarbageCollectionTestReconciler.java | 3 +- .../primarytosecondary/JobReconciler.java | 2 +- .../StandaloneDependentTestReconciler.java | 4 +- .../sample/MySQLSchemaReconciler.java | 2 +- .../WebPageDependentsWorkflowReconciler.java | 2 +- .../WebPageManagedDependentsReconciler.java | 2 +- .../operator/sample/WebPageReconciler.java | 2 +- ...WebPageStandaloneDependentsReconciler.java | 3 +- 16 files changed, 112 insertions(+), 114 deletions(-) delete mode 100644 operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ErrorStatusHandler.java diff --git a/docsy/content/en/docs/migration/v5-0-migration.md b/docsy/content/en/docs/migration/v5-0-migration.md index c766d5c770..fdf624e29c 100644 --- a/docsy/content/en/docs/migration/v5-0-migration.md +++ b/docsy/content/en/docs/migration/v5-0-migration.md @@ -60,4 +60,5 @@ description: Migrating from v4.7 to v5.0 This also means, that `BulkDependentResource` now does not automatically implement `Creator` and `Deleter` as before. Make sure to implement those interfaces in your bulk dependent resources. You can use also the new helper interface, the [`CRUDBulkDependentResource`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/CRUDBulkDependentResource.java) - what also implement `BulkUpdater` interface. \ No newline at end of file + what also implement `BulkUpdater` interface. +12. `ErrorStatusHandler` is deleted. Just delete the interface from your impl. \ No newline at end of file diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ErrorStatusHandler.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ErrorStatusHandler.java deleted file mode 100644 index c7bd09a930..0000000000 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ErrorStatusHandler.java +++ /dev/null @@ -1,28 +0,0 @@ -package io.javaoperatorsdk.operator.api.reconciler; - -import io.fabric8.kubernetes.api.model.HasMetadata; - -public interface ErrorStatusHandler

{ - - /** - *

- * Reconciler can implement this interface in order to update the status sub-resource in the case - * an exception in thrown. In that case - * {@link #updateErrorStatus(HasMetadata, Context, Exception)} is called automatically. - *

- * The result of the method call is used to make a status update on the custom resource. This is - * always a sub-resource update request, so no update on custom resource itself (like spec of - * metadata) happens. Note that this update request will also produce an event, and will result in - * a reconciliation if the controller is not generation aware. - *

- * Note that the scope of this feature is only the reconcile method of the reconciler, since there - * should not be updates on custom resource after it is marked for deletion. - * - * @param resource to update the status on - * @param context the current context - * @param e exception thrown from the reconciler - * @return the updated resource - */ - ErrorStatusUpdateControl

updateErrorStatus(P resource, Context

context, Exception e); - -} diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ErrorStatusUpdateControl.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ErrorStatusUpdateControl.java index 7236d5898b..e9073d613c 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ErrorStatusUpdateControl.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/ErrorStatusUpdateControl.java @@ -10,6 +10,7 @@ public class ErrorStatusUpdateControl

private final P resource; private boolean noRetry = false; + private final boolean defaultErrorProcessing; public static ErrorStatusUpdateControl patchStatus(T resource) { return new ErrorStatusUpdateControl<>(resource); @@ -19,8 +20,21 @@ public static ErrorStatusUpdateControl noStatusUpdate return new ErrorStatusUpdateControl<>(null); } + /** + * No special processing of the error, the error will be thrown and default error handling will + * apply + */ + public static ErrorStatusUpdateControl defaultErrorProcessing() { + return new ErrorStatusUpdateControl<>(null, true); + } + private ErrorStatusUpdateControl(P resource) { + this(resource, false); + } + + private ErrorStatusUpdateControl(P resource, boolean defaultErrorProcessing) { this.resource = resource; + this.defaultErrorProcessing = defaultErrorProcessing; } /** @@ -29,6 +43,9 @@ private ErrorStatusUpdateControl(P resource) { * @return ErrorStatusUpdateControl */ public ErrorStatusUpdateControl

withNoRetry() { + if (defaultErrorProcessing) { + throw new IllegalStateException("Cannot set no-retry for default error processing"); + } this.noRetry = true; return this; } @@ -41,6 +58,10 @@ public boolean isNoRetry() { return noRetry; } + public boolean isDefaultErrorProcessing() { + return defaultErrorProcessing; + } + /** * If re-scheduled using this method, it is not considered as retry, it effectively cancels retry. * diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java index 40a8a3b407..f271652686 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/Reconciler.java @@ -31,4 +31,28 @@ default List prepareEventSources(EventSourceContext

context) { return Collections.emptyList(); } + /** + *

+ * Reconciler can override this method in order to update the status sub-resource in the case an + * exception in thrown. In that case {@link #updateErrorStatus(HasMetadata, Context, Exception)} + * is called automatically. + *

+ * The result of the method call is used to make a status update on the custom resource. This is + * always a sub-resource update request, so no update on custom resource itself (like spec of + * metadata) happens. Note that this update request will also produce an event, and will result in + * a reconciliation if the controller is not generation aware. + *

+ * Note that the scope of this feature is only the reconcile method of the reconciler, since there + * should not be updates on custom resource after it is marked for deletion. + * + * @param resource to update the status on + * @param context the current context + * @param e exception thrown from the reconciler + * @return the updated resource + */ + default ErrorStatusUpdateControl

updateErrorStatus(P resource, Context

context, + Exception e) { + return ErrorStatusUpdateControl.defaultErrorProcessing(); + } + } diff --git a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java index 2b33133ae4..1ad3b65910 100644 --- a/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java +++ b/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcher.java @@ -22,7 +22,6 @@ import io.javaoperatorsdk.operator.api.reconciler.Context; import io.javaoperatorsdk.operator.api.reconciler.DefaultContext; import io.javaoperatorsdk.operator.api.reconciler.DeleteControl; -import io.javaoperatorsdk.operator.api.reconciler.ErrorStatusHandler; import io.javaoperatorsdk.operator.api.reconciler.RetryInfo; import io.javaoperatorsdk.operator.api.reconciler.UpdateControl; import io.javaoperatorsdk.operator.processing.Controller; @@ -174,55 +173,46 @@ private PostExecutionControl

reconcileExecution(ExecutionScope

executionSc private PostExecutionControl

handleErrorStatusHandler(P resource, P originalResource, Context

context, Exception e) throws Exception { - if (isErrorStatusHandlerPresent()) { - try { - RetryInfo retryInfo = context.getRetryInfo().orElseGet(() -> new RetryInfo() { - @Override - public int getAttemptCount() { - return 0; - } - @Override - public boolean isLastAttempt() { - // check also if the retry is limited to 0 - return retryConfigurationHasZeroAttempts || - controller.getConfiguration().getRetry() == null; - } - }); - ((DefaultContext

) context).setRetryInfo(retryInfo); - var errorStatusUpdateControl = ((ErrorStatusHandler

) controller.getReconciler()) - .updateErrorStatus(resource, context, e); - - P updatedResource = null; - if (errorStatusUpdateControl.getResource().isPresent()) { - updatedResource = customResourceFacade - .patchStatus(errorStatusUpdateControl.getResource().orElseThrow(), originalResource); - } - if (errorStatusUpdateControl.isNoRetry()) { - PostExecutionControl

postExecutionControl; - if (updatedResource != null) { - postExecutionControl = - PostExecutionControl.customResourceStatusPatched(updatedResource); - } else { - postExecutionControl = PostExecutionControl.defaultDispatch(); - } - errorStatusUpdateControl.getScheduleDelay() - .ifPresent(postExecutionControl::withReSchedule); - return postExecutionControl; - } - } catch (RuntimeException ex) { - log.error("Error during error status handling.", ex); + RetryInfo retryInfo = context.getRetryInfo().orElseGet(() -> new RetryInfo() { + @Override + public int getAttemptCount() { + return 0; } - } - throw e; - } - private boolean isErrorStatusHandlerPresent() { - return controller.getReconciler() instanceof ErrorStatusHandler; - } + @Override + public boolean isLastAttempt() { + // check also if the retry is limited to 0 + return retryConfigurationHasZeroAttempts || + controller.getConfiguration().getRetry() == null; + } + }); + ((DefaultContext

) context).setRetryInfo(retryInfo); + var errorStatusUpdateControl = controller.getReconciler() + .updateErrorStatus(resource, context, e); - private P patchStatusGenerationAware(P resource, P originalResource) { - return customResourceFacade.patchStatus(resource, originalResource); + if (errorStatusUpdateControl.isDefaultErrorProcessing()) { + throw e; + } + + P updatedResource = null; + if (errorStatusUpdateControl.getResource().isPresent()) { + updatedResource = customResourceFacade + .patchStatus(errorStatusUpdateControl.getResource().orElseThrow(), originalResource); + } + if (errorStatusUpdateControl.isNoRetry()) { + PostExecutionControl

postExecutionControl; + if (updatedResource != null) { + postExecutionControl = + PostExecutionControl.customResourceStatusPatched(updatedResource); + } else { + postExecutionControl = PostExecutionControl.defaultDispatch(); + } + errorStatusUpdateControl.getScheduleDelay() + .ifPresent(postExecutionControl::withReSchedule); + return postExecutionControl; + } + throw e; } private PostExecutionControl

createPostExecutionControl(P updatedCustomResource, diff --git a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java index 7e80f4aedc..efec8c4228 100644 --- a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java +++ b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/processing/event/ReconciliationDispatcherTest.java @@ -5,11 +5,11 @@ import java.util.Optional; import java.util.concurrent.TimeUnit; import java.util.function.BiFunction; +import java.util.function.Supplier; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; -import org.mockito.ArgumentMatcher; import org.mockito.ArgumentMatchers; import org.mockito.stubbing.Answer; @@ -28,7 +28,6 @@ import io.javaoperatorsdk.operator.api.reconciler.Cleaner; import io.javaoperatorsdk.operator.api.reconciler.Context; import io.javaoperatorsdk.operator.api.reconciler.DeleteControl; -import io.javaoperatorsdk.operator.api.reconciler.ErrorStatusHandler; import io.javaoperatorsdk.operator.api.reconciler.ErrorStatusUpdateControl; import io.javaoperatorsdk.operator.api.reconciler.Reconciler; import io.javaoperatorsdk.operator.api.reconciler.RetryInfo; @@ -479,7 +478,7 @@ void callErrorStatusHandlerIfImplemented() { reconciler.reconcile = (r, c) -> { throw new IllegalStateException("Error Status Test"); }; - reconciler.errorHandler = (r, ri, e) -> { + reconciler.errorHandler = () -> { testCustomResource.getStatus().setConfigMapStatus(ERROR_MESSAGE); return ErrorStatusUpdateControl.patchStatus(testCustomResource); }; @@ -499,7 +498,7 @@ public boolean isLastAttempt() { }).setResource(testCustomResource)); verify(customResourceFacade, times(1)).patchStatus(eq(testCustomResource), any()); - verify(((ErrorStatusHandler) reconciler), times(1)).updateErrorStatus(eq(testCustomResource), + verify(reconciler, times(1)).updateErrorStatus(eq(testCustomResource), any(), any()); } @@ -510,7 +509,7 @@ void callErrorStatusHandlerEvenOnFirstError() { reconciler.reconcile = (r, c) -> { throw new IllegalStateException("Error Status Test"); }; - reconciler.errorHandler = (r, ri, e) -> { + reconciler.errorHandler = () -> { testCustomResource.getStatus().setConfigMapStatus(ERROR_MESSAGE); return ErrorStatusUpdateControl.patchStatus(testCustomResource); }; @@ -518,7 +517,7 @@ void callErrorStatusHandlerEvenOnFirstError() { var postExecControl = reconciliationDispatcher.handleExecution( new ExecutionScope(null).setResource(testCustomResource)); verify(customResourceFacade, times(1)).patchStatus(eq(testCustomResource), any()); - verify(((ErrorStatusHandler) reconciler), times(1)).updateErrorStatus(eq(testCustomResource), + verify(reconciler, times(1)).updateErrorStatus(eq(testCustomResource), any(), any()); assertThat(postExecControl.exceptionDuringExecution()).isTrue(); } @@ -529,7 +528,7 @@ void errorHandlerCanInstructNoRetryWithUpdate() { reconciler.reconcile = (r, c) -> { throw new IllegalStateException("Error Status Test"); }; - reconciler.errorHandler = (r, ri, e) -> { + reconciler.errorHandler = () -> { testCustomResource.getStatus().setConfigMapStatus(ERROR_MESSAGE); return ErrorStatusUpdateControl.patchStatus(testCustomResource).withNoRetry(); }; @@ -537,7 +536,7 @@ void errorHandlerCanInstructNoRetryWithUpdate() { var postExecControl = reconciliationDispatcher.handleExecution( new ExecutionScope(null).setResource(testCustomResource)); - verify(((ErrorStatusHandler) reconciler), times(1)).updateErrorStatus(eq(testCustomResource), + verify(reconciler, times(1)).updateErrorStatus(eq(testCustomResource), any(), any()); verify(customResourceFacade, times(1)).patchStatus(eq(testCustomResource), any()); assertThat(postExecControl.exceptionDuringExecution()).isFalse(); @@ -549,7 +548,7 @@ void errorHandlerCanInstructNoRetryNoUpdate() { reconciler.reconcile = (r, c) -> { throw new IllegalStateException("Error Status Test"); }; - reconciler.errorHandler = (r, ri, e) -> { + reconciler.errorHandler = () -> { testCustomResource.getStatus().setConfigMapStatus(ERROR_MESSAGE); return ErrorStatusUpdateControl.noStatusUpdate().withNoRetry(); }; @@ -557,7 +556,7 @@ void errorHandlerCanInstructNoRetryNoUpdate() { var postExecControl = reconciliationDispatcher.handleExecution( new ExecutionScope(null).setResource(testCustomResource)); - verify(((ErrorStatusHandler) reconciler), times(1)).updateErrorStatus(eq(testCustomResource), + verify(reconciler, times(1)).updateErrorStatus(eq(testCustomResource), any(), any()); verify(customResourceFacade, times(0)).patchStatus(eq(testCustomResource), any()); assertThat(postExecControl.exceptionDuringExecution()).isFalse(); @@ -570,13 +569,13 @@ void errorStatusHandlerCanPatchResource() { throw new IllegalStateException("Error Status Test"); }; reconciler.errorHandler = - (r, ri, e) -> ErrorStatusUpdateControl.patchStatus(testCustomResource); + () -> ErrorStatusUpdateControl.patchStatus(testCustomResource); reconciliationDispatcher.handleExecution( new ExecutionScope(null).setResource(testCustomResource)); verify(customResourceFacade, times(1)).patchStatus(eq(testCustomResource), any()); - verify(((ErrorStatusHandler) reconciler), times(1)).updateErrorStatus(eq(testCustomResource), + verify(reconciler, times(1)).updateErrorStatus(eq(testCustomResource), any(), any()); } @@ -592,16 +591,14 @@ void ifRetryLimitedToZeroMaxAttemptsErrorHandlerGetsCorrectLastAttempt() { reconciler.reconcile = (r, c) -> { throw new IllegalStateException("Error Status Test"); }; - var mockErrorHandler = mock(ErrorStatusHandler.class); - when(mockErrorHandler.updateErrorStatus(any(), any(), any())) - .thenReturn(ErrorStatusUpdateControl.noStatusUpdate()); - reconciler.errorHandler = mockErrorHandler; + + reconciler.errorHandler = () -> ErrorStatusUpdateControl.noStatusUpdate(); reconciliationDispatcher.handleExecution( new ExecutionScope(null).setResource(testCustomResource)); - verify(mockErrorHandler, times(1)).updateErrorStatus(any(), - ArgumentMatchers.argThat((ArgumentMatcher>) context -> { + verify(reconciler, times(1)).updateErrorStatus(any(), + ArgumentMatchers.argThat(context -> { var retryInfo = context.getRetryInfo().orElseThrow(); return retryInfo.isLastAttempt(); }), any()); @@ -651,7 +648,7 @@ void reSchedulesFromErrorHandler() { throw new IllegalStateException("Error Status Test"); }; reconciler.errorHandler = - (r, ri, e) -> ErrorStatusUpdateControl.noStatusUpdate() + () -> ErrorStatusUpdateControl.noStatusUpdate() .rescheduleAfter(delay); var res = reconciliationDispatcher.handleExecution( @@ -691,12 +688,11 @@ public ExecutionScope executionScopeWithCREvent(T res } private class TestReconciler - implements Reconciler, Cleaner, - ErrorStatusHandler { + implements Reconciler, Cleaner { private BiFunction> reconcile; private BiFunction cleanup; - private ErrorStatusHandler errorHandler; + private Supplier errorHandler; @Override public UpdateControl reconcile(TestCustomResource resource, @@ -719,7 +715,7 @@ public DeleteControl cleanup(TestCustomResource resource, Context context) { public ErrorStatusUpdateControl updateErrorStatus( TestCustomResource resource, Context context, Exception e) { - return errorHandler != null ? errorHandler.updateErrorStatus(resource, context, e) + return errorHandler != null ? errorHandler.get() : ErrorStatusUpdateControl.noStatusUpdate(); } } diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/dependentresourcecrossref/DependentResourceCrossRefReconciler.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/dependentresourcecrossref/DependentResourceCrossRefReconciler.java index 0d6d63024f..c54434cf6a 100644 --- a/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/dependentresourcecrossref/DependentResourceCrossRefReconciler.java +++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/dependentresourcecrossref/DependentResourceCrossRefReconciler.java @@ -21,8 +21,7 @@ dependsOn = SECRET_NAME)}) @ControllerConfiguration public class DependentResourceCrossRefReconciler - implements Reconciler, - ErrorStatusHandler { + implements Reconciler { public static final String SECRET_NAME = "secret"; private final AtomicInteger numberOfExecutions = new AtomicInteger(0); diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/errorstatushandler/ErrorStatusHandlerTestReconciler.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/errorstatushandler/ErrorStatusHandlerTestReconciler.java index 4abf982e0f..b0c120dad2 100644 --- a/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/errorstatushandler/ErrorStatusHandlerTestReconciler.java +++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/errorstatushandler/ErrorStatusHandlerTestReconciler.java @@ -10,8 +10,7 @@ @ControllerConfiguration public class ErrorStatusHandlerTestReconciler - implements Reconciler, TestExecutionInfoProvider, - ErrorStatusHandler { + implements Reconciler, TestExecutionInfoProvider { private static final Logger log = LoggerFactory.getLogger(ErrorStatusHandlerTestReconciler.class); private final AtomicInteger numberOfExecutions = new AtomicInteger(0); diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/kubernetesdependentgarbagecollection/DependentGarbageCollectionTestReconciler.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/kubernetesdependentgarbagecollection/DependentGarbageCollectionTestReconciler.java index 569e2cafb1..a4162c09d2 100644 --- a/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/kubernetesdependentgarbagecollection/DependentGarbageCollectionTestReconciler.java +++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/kubernetesdependentgarbagecollection/DependentGarbageCollectionTestReconciler.java @@ -16,8 +16,7 @@ @ControllerConfiguration public class DependentGarbageCollectionTestReconciler - implements Reconciler, - ErrorStatusHandler { + implements Reconciler { private KubernetesClient kubernetesClient; private volatile boolean errorOccurred = false; diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/primarytosecondary/JobReconciler.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/primarytosecondary/JobReconciler.java index eaeb86cfe2..8cd64b95db 100644 --- a/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/primarytosecondary/JobReconciler.java +++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/primarytosecondary/JobReconciler.java @@ -19,7 +19,7 @@ */ @ControllerConfiguration() public class JobReconciler - implements Reconciler, ErrorStatusHandler { + implements Reconciler { private static final String JOB_CLUSTER_INDEX = "job-cluster-index"; diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/standalonedependent/StandaloneDependentTestReconciler.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/standalonedependent/StandaloneDependentTestReconciler.java index 213c699854..5525a866f0 100644 --- a/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/standalonedependent/StandaloneDependentTestReconciler.java +++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/sample/standalonedependent/StandaloneDependentTestReconciler.java @@ -9,7 +9,6 @@ import io.javaoperatorsdk.operator.StandaloneDependentResourceIT; import io.javaoperatorsdk.operator.api.reconciler.Context; import io.javaoperatorsdk.operator.api.reconciler.ControllerConfiguration; -import io.javaoperatorsdk.operator.api.reconciler.ErrorStatusHandler; import io.javaoperatorsdk.operator.api.reconciler.ErrorStatusUpdateControl; import io.javaoperatorsdk.operator.api.reconciler.EventSourceContext; import io.javaoperatorsdk.operator.api.reconciler.EventSourceUtils; @@ -20,8 +19,7 @@ @ControllerConfiguration public class StandaloneDependentTestReconciler - implements Reconciler, - ErrorStatusHandler { + implements Reconciler { private volatile boolean errorOccurred = false; DeploymentDependentResource deploymentDependent; diff --git a/sample-operators/mysql-schema/src/main/java/io/javaoperatorsdk/operator/sample/MySQLSchemaReconciler.java b/sample-operators/mysql-schema/src/main/java/io/javaoperatorsdk/operator/sample/MySQLSchemaReconciler.java index 4a6f4f4d45..7e229ca4bd 100644 --- a/sample-operators/mysql-schema/src/main/java/io/javaoperatorsdk/operator/sample/MySQLSchemaReconciler.java +++ b/sample-operators/mysql-schema/src/main/java/io/javaoperatorsdk/operator/sample/MySQLSchemaReconciler.java @@ -22,7 +22,7 @@ }) @ControllerConfiguration public class MySQLSchemaReconciler - implements Reconciler, ErrorStatusHandler { + implements Reconciler { static final Logger log = LoggerFactory.getLogger(MySQLSchemaReconciler.class); diff --git a/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageDependentsWorkflowReconciler.java b/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageDependentsWorkflowReconciler.java index f9664760f5..d8b64db9fd 100644 --- a/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageDependentsWorkflowReconciler.java +++ b/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageDependentsWorkflowReconciler.java @@ -26,7 +26,7 @@ labelSelector = WebPageDependentsWorkflowReconciler.DEPENDENT_RESOURCE_LABEL_SELECTOR) @SuppressWarnings("unused") public class WebPageDependentsWorkflowReconciler - implements Reconciler, ErrorStatusHandler { + implements Reconciler { public static final String DEPENDENT_RESOURCE_LABEL_SELECTOR = "!low-level"; diff --git a/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageManagedDependentsReconciler.java b/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageManagedDependentsReconciler.java index 32811251d7..df3cae354f 100644 --- a/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageManagedDependentsReconciler.java +++ b/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageManagedDependentsReconciler.java @@ -20,7 +20,7 @@ }) @ControllerConfiguration public class WebPageManagedDependentsReconciler - implements Reconciler, ErrorStatusHandler, Cleaner { + implements Reconciler, Cleaner { public static final String SELECTOR = "managed"; diff --git a/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageReconciler.java b/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageReconciler.java index 6669d3a1f5..68f55108db 100644 --- a/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageReconciler.java +++ b/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageReconciler.java @@ -28,7 +28,7 @@ @RateLimited(maxReconciliations = 2, within = 3) @ControllerConfiguration public class WebPageReconciler - implements Reconciler, ErrorStatusHandler { + implements Reconciler { public static final String INDEX_HTML = "index.html"; diff --git a/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageStandaloneDependentsReconciler.java b/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageStandaloneDependentsReconciler.java index 66f853e841..4b71f104f6 100644 --- a/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageStandaloneDependentsReconciler.java +++ b/sample-operators/webpage/src/main/java/io/javaoperatorsdk/operator/sample/WebPageStandaloneDependentsReconciler.java @@ -6,7 +6,6 @@ import io.fabric8.kubernetes.api.model.ConfigMap; import io.javaoperatorsdk.operator.api.reconciler.Context; import io.javaoperatorsdk.operator.api.reconciler.ControllerConfiguration; -import io.javaoperatorsdk.operator.api.reconciler.ErrorStatusHandler; import io.javaoperatorsdk.operator.api.reconciler.ErrorStatusUpdateControl; import io.javaoperatorsdk.operator.api.reconciler.EventSourceContext; import io.javaoperatorsdk.operator.api.reconciler.EventSourceUtils; @@ -31,7 +30,7 @@ */ @ControllerConfiguration public class WebPageStandaloneDependentsReconciler - implements Reconciler, ErrorStatusHandler { + implements Reconciler { private final Workflow workflow;