Migrating from v5.2 to v5.3

Migrating from v5.2 to v5.3

Automated Migration with OpenRewrite

You can automatically apply all the migration changes described below using OpenRewrite. Add the following to your pom.xml and run mvn rewrite:run:

<plugin>
  <groupId>org.openrewrite.maven</groupId>
  <artifactId>rewrite-maven-plugin</artifactId>
  <version>6.33.0</version>
  <configuration>
    <activeRecipes>
      <recipe>io.javaoperatorsdk.operator.migration.V5_3Migration</recipe>
    </activeRecipes>
  </configuration>
  <dependencies>
    <dependency>
      <groupId>io.javaoperatorsdk</groupId>
      <artifactId>migration</artifactId>
      <version>5.3.1</version>
    </dependency>
  </dependencies>
</plugin>

Rename of JUnit module

If you use JUnit extension in your test just rename it from:

<dependency>
      <groupId>io.javaoperatorsdk</groupId>
      <artifactId>operator-framework-junit-5</artifactId>
      <version>5.2.x<version>
      <scope>test</scope>
</dependency>

to

<dependency>
      <groupId>io.javaoperatorsdk</groupId>
      <artifactId>operator-framework-junit</artifactId>
      <version>5.3.0<version>
      <scope>test</scope>
</dependency>

Metrics interface changes

The Metrics interface changed in non backwards compatible way, in order to make the API cleaner:

The following table shows the relevant method renames:

v5.2 methodv5.3 method
reconcileCustomResourcereconciliationSubmitted
reconciliationExecutionStartedreconciliationStarted
reconciliationExecutionFinishedreconciliationSucceeded
failedReconciliationreconciliationFailed
finishedReconciliationreconciliationFinished
cleanupDoneForcleanupDone
receivedEventeventReceived

Other changes:

  • reconciliationFinished(..) method is extended with RetryInfo
  • monitorSizeOf(..) method is removed.

ResourceAction relocation

The ResourceAction enum has been removed from io.javaoperatorsdk.operator.processing.event.source.controller use the one in package io.javaoperatorsdk.operator.processing.event.source.ResourceAction; thus update your imports accordingly.