Skip to content

Commit e19e17d

Browse files
metacosmcsviri
authored andcommitted
chore: update to Fabric8 7.0-SNAPSHOT & replace APT by maven plugin (#2613)
* chore: update to Fabric8 7.0-SNAPSHOT & replace APT by maven plugin Signed-off-by: Bernhard Strähle <[email protected]> Signed-off-by: Chris Laprun <[email protected]> * chore(docs): add Fabric8 7 migration information Signed-off-by: Chris Laprun <[email protected]> --------- Signed-off-by: Bernhard Strähle <[email protected]> Signed-off-by: Chris Laprun <[email protected]>
1 parent 6b548e6 commit e19e17d

File tree

9 files changed

+160
-31
lines changed

9 files changed

+160
-31
lines changed

Diff for: bootstrapper-maven-plugin/src/main/resources/templates/pom.xml

+13-7
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@
4545
<version>${josdk.version}</version>
4646
<scope>test</scope>
4747
</dependency>
48-
<dependency>
49-
<groupId>io.fabric8</groupId>
50-
<artifactId>crd-generator-apt</artifactId>
51-
<version>${fabric8-client.version}</version>
52-
<scope>provided</scope>
53-
</dependency>
5448
<dependency>
5549
<groupId>org.slf4j</groupId>
5650
<artifactId>slf4j-api</artifactId>
@@ -86,7 +80,19 @@
8680
<artifactId>maven-compiler-plugin</artifactId>
8781
<version>3.11.0</version>
8882
</plugin>
83+
<plugin>
84+
<groupId>io.fabric8</groupId>
85+
<artifactId>crd-generator-maven-plugin</artifactId>
86+
<version>${fabric8-client.version}</version>
87+
<executions>
88+
<execution>
89+
<goals>
90+
<goal>generate</goal>
91+
</goals>
92+
</execution>
93+
</executions>
94+
</plugin>
8995
</plugins>
9096
</build>
9197

92-
</project>
98+
</project>

Diff for: caffeine-bounded-cache-support/pom.xml

+17-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@
3030
<version>${project.version}</version>
3131
<scope>test</scope>
3232
</dependency>
33-
<dependency>
34-
<groupId>io.fabric8</groupId>
35-
<artifactId>crd-generator-apt</artifactId>
36-
<scope>test</scope>
37-
</dependency>
3833
<dependency>
3934
<groupId>org.apache.logging.log4j</groupId>
4035
<artifactId>log4j-slf4j2-impl</artifactId>
@@ -75,6 +70,23 @@
7570
</execution>
7671
</executions>
7772
</plugin>
73+
<plugin>
74+
<groupId>io.fabric8</groupId>
75+
<artifactId>crd-generator-maven-plugin</artifactId>
76+
<version>${fabric8-client.version}</version>
77+
<executions>
78+
<execution>
79+
<goals>
80+
<goal>generate</goal>
81+
</goals>
82+
<phase>process-test-classes</phase>
83+
<configuration>
84+
<classesToScan>${project.build.testOutputDirectory}</classesToScan>
85+
<classpath>WITH_ALL_DEPENDENCIES_AND_TESTS</classpath>
86+
</configuration>
87+
</execution>
88+
</executions>
89+
</plugin>
7890
</plugins>
7991
</build>
8092

Diff for: docs/content/en/docs/migration/v5-0-migration.md

+53-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,58 @@ description: Migrating from v4.7 to v5.0
55

66
# Migrating from v4.7 to v5.0
77

8-
## API Tweaks
8+
## Fabric8 client updated to 7.0
9+
10+
The Fabric8 client has been updated to version 7.0.0. This is a new major version which implies that some API might have
11+
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).
12+
13+
### CRD generator changes
14+
15+
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.
16+
In many instances, you can simply configure the plugin by adding the following stanza to your project's POM build configuration:
17+
18+
```xml
19+
<plugin>
20+
<groupId>io.fabric8</groupId>
21+
<artifactId>crd-generator-maven-plugin</artifactId>
22+
<version>${fabric8-client.version}</version>
23+
<executions>
24+
<execution>
25+
<goals>
26+
<goal>generate</goal>
27+
</goals>
28+
</execution>
29+
</executions>
30+
</plugin>
31+
32+
```
33+
*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:
34+
```xml
35+
36+
<plugin>
37+
<groupId>io.fabric8</groupId>
38+
<artifactId>crd-generator-maven-plugin</artifactId>
39+
<version>${fabric8-client.version}</version>
40+
<executions>
41+
<execution>
42+
<goals>
43+
<goal>generate</goal>
44+
</goals>
45+
<phase>process-test-classes</phase>
46+
<configuration>
47+
<classesToScan>${project.build.testOutputDirectory}</classesToScan>
48+
<classpath>WITH_ALL_DEPENDENCIES_AND_TESTS</classpath>
49+
</configuration>
50+
</execution>
51+
</executions>
52+
</plugin>
53+
54+
```
55+
56+
Please refer to the [CRD generator documentation](https://github.com/fabric8io/kubernetes-client/blob/main/doc/CRD-generator.md) for more details.
57+
58+
59+
## API tweaks
960

1061
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)
1162
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
61112
Make sure to implement those interfaces in your bulk dependent resources. You can use also the new helper interface, the
62113
[`CRUDBulkDependentResource`](https://github.com/operator-framework/java-operator-sdk/blob/main/operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/dependent/CRUDBulkDependentResource.java)
63114
what also implement `BulkUpdater` interface.
64-
12. `ErrorStatusHandler` is deleted. Just delete the interface from your impl.
115+
12. `ErrorStatusHandler` is deleted. Just delete the interface from your impl.

Diff for: operator-framework-core/src/test/java/io/javaoperatorsdk/operator/api/config/VersionTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import org.junit.jupiter.api.Test;
44

5-
import static org.junit.Assert.assertEquals;
5+
import static org.junit.jupiter.api.Assertions.assertEquals;
66

77
class VersionTest {
88

Diff for: operator-framework/pom.xml

+17
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,23 @@
108108
</execution>
109109
</executions>
110110
</plugin>
111+
<plugin>
112+
<groupId>io.fabric8</groupId>
113+
<artifactId>crd-generator-maven-plugin</artifactId>
114+
<version>${fabric8-client.version}</version>
115+
<executions>
116+
<execution>
117+
<goals>
118+
<goal>generate</goal>
119+
</goals>
120+
<phase>process-test-classes</phase>
121+
<configuration>
122+
<classesToScan>${project.build.testOutputDirectory}</classesToScan>
123+
<classpath>WITH_ALL_DEPENDENCIES_AND_TESTS</classpath>
124+
</configuration>
125+
</execution>
126+
</executions>
127+
</plugin>
111128
<plugin>
112129
<groupId>org.apache.maven.plugins</groupId>
113130
<artifactId>maven-surefire-plugin</artifactId>

Diff for: pom.xml

+15-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<fabric8-httpclient-impl.name>jdk</fabric8-httpclient-impl.name>
6262

6363
<junit.version>5.10.1</junit.version>
64-
<fabric8-client.version>6.13.4</fabric8-client.version>
64+
<fabric8-client.version>7.0-SNAPSHOT</fabric8-client.version>
6565
<slf4j.version>2.0.12</slf4j.version>
6666
<log4j.version>2.24.2</log4j.version>
6767
<mokito.version>5.14.2</mokito.version>
@@ -239,6 +239,7 @@
239239

240240
<repositories>
241241
<repository>
242+
<!-- todo: remove before merging to main -->
242243
<snapshots>
243244
<enabled>true</enabled>
244245
<updatePolicy>always</updatePolicy>
@@ -247,6 +248,19 @@
247248
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
248249
</repository>
249250
</repositories>
251+
252+
<pluginRepositories>
253+
<pluginRepository>
254+
<!-- todo: remove before merging to main -->
255+
<snapshots>
256+
<enabled>true</enabled>
257+
<updatePolicy>always</updatePolicy>
258+
</snapshots>
259+
<id>ossrh</id>
260+
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
261+
</pluginRepository>
262+
</pluginRepositories>
263+
250264
<build>
251265
<pluginManagement>
252266
<plugins>

Diff for: sample-operators/mysql-schema/pom.xml

+12-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
<artifactId>mysql-connector-java</artifactId>
4545
<version>8.0.30</version>
4646
</dependency>
47-
<dependency>
48-
<groupId>io.fabric8</groupId>
49-
<artifactId>crd-generator-apt</artifactId>
50-
<scope>provided</scope>
51-
</dependency>
5247
<dependency>
5348
<groupId>org.apache.logging.log4j</groupId>
5449
<artifactId>log4j-slf4j2-impl</artifactId>
@@ -82,6 +77,18 @@
8277

8378
<build>
8479
<plugins>
80+
<plugin>
81+
<groupId>io.fabric8</groupId>
82+
<artifactId>crd-generator-maven-plugin</artifactId>
83+
<version>${fabric8-client.version}</version>
84+
<executions>
85+
<execution>
86+
<goals>
87+
<goal>generate</goal>
88+
</goals>
89+
</execution>
90+
</executions>
91+
</plugin>
8592
<plugin>
8693
<groupId>org.apache.maven.plugins</groupId>
8794
<artifactId>maven-surefire-plugin</artifactId>

Diff for: sample-operators/tomcat-operator/pom.xml

+16-5
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,6 @@
4040
<groupId>io.fabric8</groupId>
4141
<artifactId>kubernetes-httpclient-vertx</artifactId>
4242
</dependency>
43-
<dependency>
44-
<groupId>io.fabric8</groupId>
45-
<artifactId>crd-generator-apt</artifactId>
46-
<scope>provided</scope>
47-
</dependency>
4843
<dependency>
4944
<groupId>org.apache.logging.log4j</groupId>
5045
<artifactId>log4j-slf4j2-impl</artifactId>
@@ -104,6 +99,22 @@
10499
</to>
105100
</configuration>
106101
</plugin>
102+
<plugin>
103+
<groupId>org.apache.maven.plugins</groupId>
104+
<artifactId>maven-compiler-plugin</artifactId>
105+
</plugin>
106+
<plugin>
107+
<groupId>io.fabric8</groupId>
108+
<artifactId>crd-generator-maven-plugin</artifactId>
109+
<version>${fabric8-client.version}</version>
110+
<executions>
111+
<execution>
112+
<goals>
113+
<goal>generate</goal>
114+
</goals>
115+
</execution>
116+
</executions>
117+
</plugin>
107118
</plugins>
108119
</build>
109120

Diff for: sample-operators/webpage/pom.xml

+16-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@
4444
<artifactId>takes</artifactId>
4545
<version>1.24.4</version>
4646
</dependency>
47-
<dependency>
48-
<groupId>io.fabric8</groupId>
49-
<artifactId>crd-generator-apt</artifactId>
50-
<scope>provided</scope>
51-
</dependency>
5247
<dependency>
5348
<groupId>org.awaitility</groupId>
5449
<artifactId>awaitility</artifactId>
@@ -75,6 +70,22 @@
7570
</to>
7671
</configuration>
7772
</plugin>
73+
<plugin>
74+
<groupId>org.apache.maven.plugins</groupId>
75+
<artifactId>maven-compiler-plugin</artifactId>
76+
</plugin>
77+
<plugin>
78+
<groupId>io.fabric8</groupId>
79+
<artifactId>crd-generator-maven-plugin</artifactId>
80+
<version>${fabric8-client.version}</version>
81+
<executions>
82+
<execution>
83+
<goals>
84+
<goal>generate</goal>
85+
</goals>
86+
</execution>
87+
</executions>
88+
</plugin>
7889
</plugins>
7990
</build>
8091

0 commit comments

Comments
 (0)