From 8106f53be825613c664be4b3952a1be60bee52ea Mon Sep 17 00:00:00 2001 From: Chris Laprun Date: Thu, 26 Sep 2024 10:13:16 +0200 Subject: [PATCH 1/6] chore: update to Fabric8 7.0-SNAPSHOT for testing Signed-off-by: Chris Laprun --- pom.xml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c7395808b7..7ccb99dcf6 100644 --- a/pom.xml +++ b/pom.xml @@ -44,7 +44,7 @@ okhttp 5.10.1 - 6.13.4 + 7.0-SNAPSHOT 1.7.36 2.24.2 5.14.2 @@ -241,6 +241,17 @@ + + + ossrh + https://oss.sonatype.org/content/repositories/snapshots/ + + true + always + + + + ossrh From fa9154a91aa6a4adf62f0c00d95aaf64da40ed13 Mon Sep 17 00:00:00 2001 From: Chris Laprun Date: Tue, 12 Nov 2024 16:07:12 +0100 Subject: [PATCH 2/6] fix: wrong import Signed-off-by: Chris Laprun --- .../io/javaoperatorsdk/operator/api/config/VersionTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 { From fa3230195b1ec0b51e4fb6a0276c7d6aea67e945 Mon Sep 17 00:00:00 2001 From: Chris Laprun Date: Thu, 28 Nov 2024 18:04:49 +0100 Subject: [PATCH 3/6] feat: replace CRD generator annotation processor by maven plugin Signed-off-by: Chris Laprun --- .../src/main/resources/templates/pom.xml | 20 ++++++++++++------- caffeine-bounded-cache-support/pom.xml | 19 ++++++++++++------ operator-framework/pom.xml | 17 +++++++++++----- sample-operators/mysql-schema/pom.xml | 19 ++++++++++++------ sample-operators/tomcat-operator/pom.xml | 20 ++++++++++++------- sample-operators/webpage/pom.xml | 20 ++++++++++++------- 6 files changed, 77 insertions(+), 38 deletions(-) diff --git a/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml b/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml index fe9d29300e..01d9f11b8a 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 2010056cda..c604009bdc 100644 --- a/caffeine-bounded-cache-support/pom.xml +++ b/caffeine-bounded-cache-support/pom.xml @@ -37,11 +37,6 @@ ${project.version} test - - io.fabric8 - crd-generator-apt - test - org.apache.logging.log4j log4j-slf4j-impl @@ -82,7 +77,19 @@ + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + + + - \ No newline at end of file + diff --git a/operator-framework/pom.xml b/operator-framework/pom.xml index 1f18cbc2a9..e44df1c279 100644 --- a/operator-framework/pom.xml +++ b/operator-framework/pom.xml @@ -59,11 +59,6 @@ compile-testing test - - io.fabric8 - crd-generator-apt - test - io.fabric8 @@ -115,6 +110,18 @@ + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + + + diff --git a/sample-operators/mysql-schema/pom.xml b/sample-operators/mysql-schema/pom.xml index 05976306a9..0017ac74ed 100644 --- a/sample-operators/mysql-schema/pom.xml +++ b/sample-operators/mysql-schema/pom.xml @@ -52,11 +52,6 @@ mysql-connector-java 8.0.30 - - io.fabric8 - crd-generator-apt - provided - org.apache.logging.log4j log4j-slf4j-impl @@ -85,6 +80,18 @@ + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + + + org.apache.maven.plugins maven-surefire-plugin @@ -113,4 +120,4 @@ - \ No newline at end of file + diff --git a/sample-operators/tomcat-operator/pom.xml b/sample-operators/tomcat-operator/pom.xml index 7bf3ce14d5..471d43d4ed 100644 --- a/sample-operators/tomcat-operator/pom.xml +++ b/sample-operators/tomcat-operator/pom.xml @@ -48,11 +48,6 @@ io.fabric8 kubernetes-httpclient-vertx - - io.fabric8 - crd-generator-apt - provided - org.apache.logging.log4j log4j-slf4j-impl @@ -110,9 +105,20 @@ org.apache.maven.plugins maven-compiler-plugin - 3.12.1 + + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + + - \ No newline at end of file + diff --git a/sample-operators/webpage/pom.xml b/sample-operators/webpage/pom.xml index 348581cd38..cda7e1e46f 100644 --- a/sample-operators/webpage/pom.xml +++ b/sample-operators/webpage/pom.xml @@ -47,11 +47,6 @@ takes 1.24.4 - - io.fabric8 - crd-generator-apt - provided - org.awaitility awaitility @@ -81,9 +76,20 @@ org.apache.maven.plugins maven-compiler-plugin - 3.12.1 + + + io.fabric8 + crd-generator-maven-plugin + ${fabric8-client.version} + + + + generate + + + - \ No newline at end of file + From e1feb410516c1653d5b04744b32b01563ace1517 Mon Sep 17 00:00:00 2001 From: Chris Laprun Date: Fri, 29 Nov 2024 19:45:05 +0100 Subject: [PATCH 4/6] fix: also consider test classes when looking for CustomResources Signed-off-by: Chris Laprun --- bootstrapper-maven-plugin/src/main/resources/templates/pom.xml | 3 +++ caffeine-bounded-cache-support/pom.xml | 3 +++ operator-framework/pom.xml | 3 +++ sample-operators/mysql-schema/pom.xml | 3 +++ sample-operators/tomcat-operator/pom.xml | 3 +++ sample-operators/webpage/pom.xml | 3 +++ 6 files changed, 18 insertions(+) diff --git a/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml b/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml index 01d9f11b8a..ea7699dea8 100644 --- a/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml +++ b/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml @@ -89,6 +89,9 @@ generate + + WITH_ALL_DEPENDENCIES_AND_TESTS + diff --git a/caffeine-bounded-cache-support/pom.xml b/caffeine-bounded-cache-support/pom.xml index c604009bdc..ca5dbf8b90 100644 --- a/caffeine-bounded-cache-support/pom.xml +++ b/caffeine-bounded-cache-support/pom.xml @@ -86,6 +86,9 @@ generate + + WITH_ALL_DEPENDENCIES_AND_TESTS + diff --git a/operator-framework/pom.xml b/operator-framework/pom.xml index e44df1c279..dac36571da 100644 --- a/operator-framework/pom.xml +++ b/operator-framework/pom.xml @@ -119,6 +119,9 @@ generate + + WITH_ALL_DEPENDENCIES_AND_TESTS + diff --git a/sample-operators/mysql-schema/pom.xml b/sample-operators/mysql-schema/pom.xml index 0017ac74ed..84ab638cd0 100644 --- a/sample-operators/mysql-schema/pom.xml +++ b/sample-operators/mysql-schema/pom.xml @@ -89,6 +89,9 @@ generate + + WITH_ALL_DEPENDENCIES_AND_TESTS + diff --git a/sample-operators/tomcat-operator/pom.xml b/sample-operators/tomcat-operator/pom.xml index 471d43d4ed..724873b78d 100644 --- a/sample-operators/tomcat-operator/pom.xml +++ b/sample-operators/tomcat-operator/pom.xml @@ -115,6 +115,9 @@ generate + + WITH_ALL_DEPENDENCIES_AND_TESTS + diff --git a/sample-operators/webpage/pom.xml b/sample-operators/webpage/pom.xml index cda7e1e46f..96932c7fcc 100644 --- a/sample-operators/webpage/pom.xml +++ b/sample-operators/webpage/pom.xml @@ -86,6 +86,9 @@ generate + + WITH_ALL_DEPENDENCIES_AND_TESTS + From 2a552710f116da727cd7be4b4960e737934575d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Str=C3=A4hle?= Date: Sat, 30 Nov 2024 13:31:50 +0100 Subject: [PATCH 5/6] Fix CRD-Generator tests and examples (#2612) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bernhard Strähle --- bootstrapper-maven-plugin/src/main/resources/templates/pom.xml | 3 --- operator-framework/pom.xml | 2 ++ .../javaoperatorsdk/operator/CRDMappingInTestExtensionIT.java | 2 +- .../operator/config/runtime/TestCustomResource.java | 2 +- sample-operators/mysql-schema/pom.xml | 3 --- sample-operators/tomcat-operator/pom.xml | 3 --- sample-operators/webpage/pom.xml | 3 --- 7 files changed, 4 insertions(+), 14 deletions(-) diff --git a/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml b/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml index ea7699dea8..01d9f11b8a 100644 --- a/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml +++ b/bootstrapper-maven-plugin/src/main/resources/templates/pom.xml @@ -89,9 +89,6 @@ generate - - WITH_ALL_DEPENDENCIES_AND_TESTS - diff --git a/operator-framework/pom.xml b/operator-framework/pom.xml index dac36571da..1aceaa6556 100644 --- a/operator-framework/pom.xml +++ b/operator-framework/pom.xml @@ -119,7 +119,9 @@ generate + process-test-classes + ${project.build.testOutputDirectory} WITH_ALL_DEPENDENCIES_AND_TESTS diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/CRDMappingInTestExtensionIT.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/CRDMappingInTestExtensionIT.java index 09b52f1078..5325742d5f 100644 --- a/operator-framework/src/test/java/io/javaoperatorsdk/operator/CRDMappingInTestExtensionIT.java +++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/CRDMappingInTestExtensionIT.java @@ -43,7 +43,7 @@ void correctlyAppliesManuallySpecifiedCRD() { @Group("crd.example") @Version("v1") @Kind("Test") - private static class TestCR extends CustomResource implements Namespaced { + public static class TestCR extends CustomResource implements Namespaced { } @ControllerConfiguration diff --git a/operator-framework/src/test/java/io/javaoperatorsdk/operator/config/runtime/TestCustomResource.java b/operator-framework/src/test/java/io/javaoperatorsdk/operator/config/runtime/TestCustomResource.java index 0f94ae92e4..1a75ffaa94 100644 --- a/operator-framework/src/test/java/io/javaoperatorsdk/operator/config/runtime/TestCustomResource.java +++ b/operator-framework/src/test/java/io/javaoperatorsdk/operator/config/runtime/TestCustomResource.java @@ -7,5 +7,5 @@ @Group("sample.javaoperatorsdk") @Version("v1") -class TestCustomResource extends CustomResource implements Namespaced { +public class TestCustomResource extends CustomResource implements Namespaced { } diff --git a/sample-operators/mysql-schema/pom.xml b/sample-operators/mysql-schema/pom.xml index 84ab638cd0..0017ac74ed 100644 --- a/sample-operators/mysql-schema/pom.xml +++ b/sample-operators/mysql-schema/pom.xml @@ -89,9 +89,6 @@ generate - - WITH_ALL_DEPENDENCIES_AND_TESTS - diff --git a/sample-operators/tomcat-operator/pom.xml b/sample-operators/tomcat-operator/pom.xml index 724873b78d..471d43d4ed 100644 --- a/sample-operators/tomcat-operator/pom.xml +++ b/sample-operators/tomcat-operator/pom.xml @@ -115,9 +115,6 @@ generate - - WITH_ALL_DEPENDENCIES_AND_TESTS - diff --git a/sample-operators/webpage/pom.xml b/sample-operators/webpage/pom.xml index 96932c7fcc..cda7e1e46f 100644 --- a/sample-operators/webpage/pom.xml +++ b/sample-operators/webpage/pom.xml @@ -86,9 +86,6 @@ generate - - WITH_ALL_DEPENDENCIES_AND_TESTS - From 27b821ecb2e698389173888c63110604d87d6ae8 Mon Sep 17 00:00:00 2001 From: Chris Laprun Date: Sat, 30 Nov 2024 14:23:48 +0100 Subject: [PATCH 6/6] fix: also consider test classes when looking for CustomResources Signed-off-by: Chris Laprun --- caffeine-bounded-cache-support/pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/caffeine-bounded-cache-support/pom.xml b/caffeine-bounded-cache-support/pom.xml index ca5dbf8b90..b02b3e1d53 100644 --- a/caffeine-bounded-cache-support/pom.xml +++ b/caffeine-bounded-cache-support/pom.xml @@ -86,7 +86,9 @@ generate + process-test-classes + ${project.build.testOutputDirectory} WITH_ALL_DEPENDENCIES_AND_TESTS