From 87073ddd34b75aee17601d50916a4e3f369f9ccf Mon Sep 17 00:00:00 2001 From: Chris Laprun Date: Thu, 26 Sep 2024 10:13:16 +0200 Subject: [PATCH 1/2] chore: update to Fabric8 7.0-SNAPSHOT & replace APT by maven plugin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernhard Strähle Signed-off-by: Chris Laprun --- .../src/main/resources/templates/pom.xml | 20 +++++++++++------ caffeine-bounded-cache-support/pom.xml | 22 ++++++++++++++----- .../operator/api/config/VersionTest.java | 2 +- operator-framework/pom.xml | 17 ++++++++++++++ pom.xml | 16 +++++++++++++- sample-operators/mysql-schema/pom.xml | 17 +++++++++----- sample-operators/tomcat-operator/pom.xml | 21 +++++++++++++----- sample-operators/webpage/pom.xml | 21 +++++++++++++----- 8 files changed, 107 insertions(+), 29 deletions(-) diff --git a/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml b/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml index 6a835598a3..11d4288421 100644 --- a/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml +++ b/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml @@ -45,12 +45,6 @@ ${josdk.version} test - - io.fabric8 - crd-generator-apt - ${fabric8-client.version} - provided - org.slf4j slf4j-api @@ -86,7 +80,19 @@ maven-compiler-plugin 3.11.0 + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + + + - \ No newline at end of file + diff --git a/caffeine-bounded-cache-support/pom.xml b/caffeine-bounded-cache-support/pom.xml index d0840f420a..fccdec8aab 100644 --- a/caffeine-bounded-cache-support/pom.xml +++ b/caffeine-bounded-cache-support/pom.xml @@ -30,11 +30,6 @@ ${project.version} test - - io.fabric8 - crd-generator-apt - test - org.apache.logging.log4j log4j-slf4j2-impl @@ -75,6 +70,23 @@ + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + process-test-classes + + ${project.build.testOutputDirectory} + WITH_ALL_DEPENDENCIES_AND_TESTS + + + + diff --git a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/VersionTest.java b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/VersionTest.java index f59b619996..d902a75860 100644 --- a/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/VersionTest.java +++ b/operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/VersionTest.java @@ -2,7 +2,7 @@ import org.junit.jupiter.api.Test; -import static org.junit.Assert.assertEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; class VersionTest { diff --git a/operator-framework/pom.xml b/operator-framework/pom.xml index 455b1268fd..b2f43380e8 100644 --- a/operator-framework/pom.xml +++ b/operator-framework/pom.xml @@ -108,6 +108,23 @@ + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + process-test-classes + + ${project.build.testOutputDirectory} + WITH_ALL_DEPENDENCIES_AND_TESTS + + + + org.apache.maven.plugins maven-surefire-plugin diff --git a/pom.xml b/pom.xml index 930178b9fa..4dd3273be0 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ jdk 5.10.1 - 6.13.4 + 7.0-SNAPSHOT 2.0.12 2.24.2 5.14.2 @@ -239,6 +239,7 @@ + true always @@ -247,6 +248,19 @@ https://oss.sonatype.org/content/repositories/snapshots/ + + + + + + true + always + + ossrh + https://oss.sonatype.org/content/repositories/snapshots/ + + + diff --git a/sample-operators/mysql-schema/pom.xml b/sample-operators/mysql-schema/pom.xml index 46d555966c..27aec54945 100644 --- a/sample-operators/mysql-schema/pom.xml +++ b/sample-operators/mysql-schema/pom.xml @@ -44,11 +44,6 @@ mysql-connector-java 8.0.30 - - io.fabric8 - crd-generator-apt - provided - org.apache.logging.log4j log4j-slf4j2-impl @@ -82,6 +77,18 @@ + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + + + org.apache.maven.plugins maven-surefire-plugin diff --git a/sample-operators/tomcat-operator/pom.xml b/sample-operators/tomcat-operator/pom.xml index d22260c614..0dab30ee60 100644 --- a/sample-operators/tomcat-operator/pom.xml +++ b/sample-operators/tomcat-operator/pom.xml @@ -40,11 +40,6 @@ io.fabric8 kubernetes-httpclient-vertx - - io.fabric8 - crd-generator-apt - provided - org.apache.logging.log4j log4j-slf4j2-impl @@ -104,6 +99,22 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + + + diff --git a/sample-operators/webpage/pom.xml b/sample-operators/webpage/pom.xml index 34b6846b94..995152f555 100644 --- a/sample-operators/webpage/pom.xml +++ b/sample-operators/webpage/pom.xml @@ -44,11 +44,6 @@ takes 1.24.4 - - io.fabric8 - crd-generator-apt - provided - org.awaitility awaitility @@ -75,6 +70,22 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + + + From f7f54f41c1218df820389cc87cc52ae7eac61be2 Mon Sep 17 00:00:00 2001 From: Chris Laprun Date: Mon, 2 Dec 2024 15:33:04 +0100 Subject: [PATCH 2/2] chore(docs): add Fabric8 7 migration information Signed-off-by: Chris Laprun --- .../en/docs/migration/v5-0-migration.md | 55 ++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/docs/content/en/docs/migration/v5-0-migration.md b/docs/content/en/docs/migration/v5-0-migration.md index fdf624e29c..0ed8f8ae6d 100644 --- a/docs/content/en/docs/migration/v5-0-migration.md +++ b/docs/content/en/docs/migration/v5-0-migration.md @@ -5,7 +5,58 @@ description: Migrating from v4.7 to v5.0 # Migrating from v4.7 to v5.0 -## API Tweaks +## Fabric8 client updated to 7.0 + +The Fabric8 client has been updated to version 7.0.0. This is a new major version which implies that some API might have +changed. Please take a look at the [Fabric8 client 7.0.0 migration guide](https://github.com/fabric8io/kubernetes-client/blob/main/doc/MIGRATION-v7.md). + +### CRD generator changes + +Starting with v5.0 (in accordance with changes made to the Fabric8 client in version 7.0.0), the CRD generator will use the maven plugin instead of the annotation processor as was previously the case. +In many instances, you can simply configure the plugin by adding the following stanza to your project's POM build configuration: + +```xml + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + + + + +``` +*NOTE*: If you use the SDK's JUnit extension for your tests, you might also need to configure the CRD generator plugin to access your test `CustomResource` implementations as follows: +```xml + + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + process-test-classes + + ${project.build.testOutputDirectory} + WITH_ALL_DEPENDENCIES_AND_TESTS + + + + + +``` + +Please refer to the [CRD generator documentation](https://github.com/fabric8io/kubernetes-client/blob/main/doc/CRD-generator.md) for more details. + + +## API tweaks 1. [Result of managed dependent resources](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/reconciler/dependent/managed/ManagedDependentResourceContext.java#L55-L57) is not `Optional` anymore. In case you use this result, simply use the result @@ -61,4 +112,4 @@ description: Migrating from v4.7 to v5.0 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. -12. `ErrorStatusHandler` is deleted. Just delete the interface from your impl. \ No newline at end of file +12. `ErrorStatusHandler` is deleted. Just delete the interface from your impl.