Skip to content

Commit 7e4348e

Browse files
authored
Merge branch 'main' into dependabot/maven/org.slf4j-slf4j-api-2.0.17
2 parents 12e2490 + 98c4dea commit 7e4348e

File tree

753 files changed

+13380
-10505
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

753 files changed

+13380
-10505
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -5,73 +5,35 @@ env:
55

66
on:
77
workflow_call:
8-
inputs:
9-
kube-version:
10-
type: string
11-
required: true
128

139
jobs:
14-
set_up_kubernetes:
15-
name: Set up Kubernetes ${{ inputs.kube-version }}
16-
runs-on: ubuntu-latest
17-
steps:
18-
- uses: actions/checkout@v4
19-
20-
- name: Set up Minikube
21-
uses: manusa/[email protected]
22-
with:
23-
minikube version: 'v1.34.0'
24-
kubernetes version: '${{ inputs.kube-version }}'
25-
driver: 'docker'
26-
github token: ${{ secrets.GITHUB_TOKEN }}
27-
28-
- name: Save minikube directory
29-
id: minikube
30-
run: |
31-
echo "minikube-dir=$MINIKUBE_HOME" >> $GITHUB_OUTPUT
32-
33-
- name: Upload minikube
34-
uses: actions/upload-artifact@v4
35-
with:
36-
name: minikube-${{ inputs.kube-version }}
37-
path: ${{ steps.minikube.outputs.minikube-dir }}
38-
include-hidden-files: true
39-
4010
integration_tests:
41-
name: "JDK: ${{ matrix.java }}, IT category: ${{ matrix.it-category }}"
42-
needs: set_up_kubernetes
4311
strategy:
4412
matrix:
45-
java: [ 17, 21 ]
46-
it-category: [ 'baseapi', 'dependent', 'workflow' ]
13+
java: [ 17, 21, 24 ]
14+
kubernetes: [ '1.30.12', '1.31.8', '1.32.4','1.33.0' ]
4715
uses: ./.github/workflows/integration-tests.yml
4816
with:
49-
kube-version: ${{ inputs.kube-version }}
5017
java-version: ${{ matrix.java }}
51-
it-category: ${{ matrix.it-category }}
18+
kube-version: ${{ matrix.kubernetes }}
5219

53-
http_client_tests:
54-
name: "JDK: ${{ matrix.java }}, IT category: ${{ matrix.it-category }}, HTTP client: ${{ matrix.httpclient }}"
55-
needs: set_up_kubernetes
20+
httpclient-tests:
5621
strategy:
5722
matrix:
58-
java: [ 17, 21 ]
59-
it-category: [ 'baseapi' ]
6023
httpclient: [ 'vertx', 'jdk', 'jetty' ]
6124
uses: ./.github/workflows/integration-tests.yml
6225
with:
63-
kube-version: ${{ inputs.kube-version }}
64-
java-version: ${{ matrix.java }}
65-
it-category: ${{ matrix.it-category }}
26+
java-version: 24
27+
kube-version: '1.32.0'
6628
http-client: ${{ matrix.httpclient }}
29+
experimental: true
6730

6831
special_integration_tests:
6932
name: "Special integration tests (${{ matrix.java }})"
70-
needs: set_up_kubernetes
7133
runs-on: ubuntu-latest
7234
strategy:
7335
matrix:
74-
java: [ 17, 21 ]
36+
java: [ 17, 21, 24 ]
7537
steps:
7638
- uses: actions/checkout@v4
7739
- name: Set up Java and Maven
@@ -81,13 +43,3 @@ jobs:
8143
java-version: ${{ matrix.java }}
8244
- name: Run Special Integration Tests
8345
run: ./mvnw ${MAVEN_ARGS} -B package -P minimal-watch-timeout-dependent-it --file pom.xml
84-
85-
delete_kubernetes:
86-
needs: [ integration_tests, http_client_tests, special_integration_tests ]
87-
if: always()
88-
name: Delete Kubernetes ${{ inputs.kube-version }} artifact
89-
runs-on: ubuntu-latest
90-
steps:
91-
- uses: geekyeggo/delete-artifact@v5
92-
with:
93-
name: minikube-${{ inputs.kube-version }}

.github/workflows/e2e-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ jobs:
3030
uses: actions/checkout@v4
3131

3232
- name: Setup Minikube-Kubernetes
33-
uses: manusa/actions-setup-minikube@v2.13.1
33+
uses: manusa/actions-setup-minikube@v2.14.0
3434
with:
3535
minikube version: v1.34.0
36-
kubernetes version: v1.32.0
36+
kubernetes version: v1.33.0
3737
github token: ${{ secrets.GITHUB_TOKEN }}
3838
driver: docker
3939

.github/workflows/fabric8-next-version-schedule.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

.github/workflows/hugo.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
build:
3333
runs-on: ubuntu-latest
3434
env:
35-
HUGO_VERSION: 0.125.4
35+
HUGO_VERSION: 0.145.0
3636
steps:
3737
- name: Install Hugo CLI
3838
run: |

.github/workflows/integration-tests.yml

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,14 @@ on:
2121
type: string
2222
required: false
2323
default: ''
24-
it-category:
25-
type: string
26-
required: false
27-
default: ''
2824

2925
jobs:
3026
integration_tests:
31-
name: "Experimental: ${{ inputs.experimental }}, Checkout ref: ${{ inputs.checkout-ref }}"
27+
name: Integration tests (${{ inputs.java-version }}, ${{ inputs.kube-version }}, ${{ inputs.http-client }})
3228
runs-on: ubuntu-latest
3329
continue-on-error: ${{ inputs.experimental }}
3430
timeout-minutes: 40
3531
steps:
36-
- name: Output test information
37-
run: echo "Running ITs with ${{ inputs.http-client }}, ${{ inputs.kube-version }}, ${{ inputs.java-version }}"
3832
- uses: actions/checkout@v4
3933
with:
4034
ref: ${{ inputs.checkout-ref }}
@@ -44,18 +38,13 @@ jobs:
4438
distribution: temurin
4539
java-version: ${{ inputs.java-version }}
4640
cache: 'maven'
47-
- name: Download minikube artifact for Kubernetes ${{ inputs.kube-version }}
48-
uses: actions/download-artifact@v4
41+
- name: Set up Minikube
42+
uses: manusa/[email protected]
4943
with:
50-
name: minikube-${{inputs.kube-version}}
51-
path: minikube
52-
- name: Start minikube with Kubernetes ${{ inputs.kube-version }}
53-
run: |
54-
# wait for docker
55-
docker version -f '{{.Server.Version}} - {{.Client.Version}}'
56-
export MINIKUBE_HOME=$PWD/minikube
57-
minikube start --driver=docker
58-
kubectl version
44+
minikube version: 'v1.34.0'
45+
kubernetes version: '${{ inputs.kube-version }}'
46+
driver: 'docker'
47+
github token: ${{ secrets.GITHUB_TOKEN }}
5948
- name: "${{inputs.it-category}} integration tests (kube: ${{ inputs.kube-version }} / java: ${{ inputs.java-version }} / client: ${{ inputs.http-client }})"
6049
run: |
6150
if [ -z "${{inputs.it-category}}" ]; then

.github/workflows/pr.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
uses: actions/setup-java@v4
2323
with:
2424
distribution: temurin
25-
java-version: 17
25+
java-version: 21
2626
cache: 'maven'
2727
- name: Check code format
2828
run: |
@@ -31,10 +31,4 @@ jobs:
3131
run: ./mvnw ${MAVEN_ARGS} clean install -Pno-apt --file pom.xml
3232

3333
build:
34-
name: Integration tests with Kubernetes ${{ matrix.kubernetes }}
35-
strategy:
36-
matrix:
37-
kubernetes: [ 'v1.29.12','1.30.8', '1.31.4', '1.32.0' ]
3834
uses: ./.github/workflows/build.yml
39-
with:
40-
kube-version: ${{ matrix.kubernetes }}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"java.format.settings.url": "contributing/eclipse-google-style.xml",
2+
"java.format.settings.url": "https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml",
33
"java.completion.importOrder": [
44
"java",
55
"javax",

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ The SDK modules and samples are formatted to follow the Java Google code style.
6262
On every `compile` the code gets formatted automatically,
6363
however, to make things simpler (i.e. avoid getting a PR rejected simply because of code style issues), you can import one of the following code style schemes based on the IDE you use:
6464

65-
- for *IntelliJ IDEA*:
66-
- Install the [Eclipse Code Formatter plugin](https://github.com/krasa/EclipseCodeFormatter#instructions)
67-
- Use [contributing/eclipse-google-style.xml](contributing/eclipse-google-style.xml) for the Eclipse formatter config file
68-
- for *Eclipse* import [contributing/eclipse-google-style.xml](contributing/eclipse-google-style.xml)
65+
- for *Intellij IDEA*
66+
install [google-java-format](https://plugins.jetbrains.com/plugin/8527-google-java-format) plugin
67+
- for *Eclipse*
68+
follow [these intructions](https://github.com/google/google-java-format?tab=readme-ov-file#eclipse)
6969

7070
## Thanks
7171

bootstrapper-maven-plugin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.javaoperatorsdk</groupId>
77
<artifactId>java-operator-sdk</artifactId>
8-
<version>5.0.4-SNAPSHOT</version>
8+
<version>5.1.2-SNAPSHOT</version>
99
</parent>
1010

1111
<artifactId>bootstrapper</artifactId>
@@ -58,7 +58,7 @@
5858
<dependency>
5959
<groupId>commons-io</groupId>
6060
<artifactId>commons-io</artifactId>
61-
<version>2.18.0</version>
61+
<version>2.19.0</version>
6262
</dependency>
6363
<dependency>
6464
<groupId>com.github.spullara.mustache.java</groupId>

bootstrapper-maven-plugin/src/main/java/io/javaoperatorsdk/boostrapper/Bootstrapper.java

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ public class Bootstrapper {
2727
private static final Map<String, String> TOP_LEVEL_STATIC_FILES =
2828
Map.of("_.gitignore", ".gitignore", "README.md", "README.md");
2929
private static final List<String> JAVA_FILES =
30-
List.of("CustomResource.java", "Reconciler.java",
31-
"Spec.java", "Status.java");
30+
List.of("CustomResource.java", "Reconciler.java", "Spec.java", "Status.java");
3231

3332
public void create(File targetDir, String groupId, String artifactId) {
3433
try {
@@ -61,42 +60,62 @@ private void addJavaFiles(File projectDir, String groupId, String artifactId) {
6160
var targetTestDir = new File(projectDir, "src/test/java/" + packages);
6261
FileUtils.forceMkdir(targetDir);
6362
var classFileNamePrefix = artifactClassId(artifactId);
64-
JAVA_FILES.forEach(f -> addTemplatedFile(projectDir, f, groupId, artifactId, targetDir,
65-
classFileNamePrefix + f));
63+
JAVA_FILES.forEach(
64+
f ->
65+
addTemplatedFile(
66+
projectDir, f, groupId, artifactId, targetDir, classFileNamePrefix + f));
6667

6768
addTemplatedFile(projectDir, "Runner.java", groupId, artifactId, targetDir, null);
68-
addTemplatedFile(projectDir, "ConfigMapDependentResource.java", groupId, artifactId,
69-
targetDir, null);
70-
addTemplatedFile(projectDir, "ReconcilerIntegrationTest.java", groupId,
69+
addTemplatedFile(
70+
projectDir, "ConfigMapDependentResource.java", groupId, artifactId, targetDir, null);
71+
addTemplatedFile(
72+
projectDir,
73+
"ReconcilerIntegrationTest.java",
74+
groupId,
7175
artifactId,
72-
targetTestDir, artifactClassId(artifactId) + "ReconcilerIntegrationTest.java");
76+
targetTestDir,
77+
artifactClassId(artifactId) + "ReconcilerIntegrationTest.java");
7378
} catch (IOException e) {
7479
throw new RuntimeException(e);
7580
}
76-
7781
}
7882

7983
private void addTemplatedFiles(File projectDir, String groupId, String artifactId) {
8084
addTemplatedFile(projectDir, "pom.xml", groupId, artifactId);
8185
addTemplatedFile(projectDir, "k8s/test-resource.yaml", groupId, artifactId);
8286
}
8387

84-
private void addTemplatedFile(File projectDir, String fileName, String groupId,
85-
String artifactId) {
88+
private void addTemplatedFile(
89+
File projectDir, String fileName, String groupId, String artifactId) {
8690
addTemplatedFile(projectDir, fileName, groupId, artifactId, null, null);
8791
}
8892

89-
private void addTemplatedFile(File projectDir, String fileName, String groupId, String artifactId,
90-
File targetDir, String targetFileName) {
93+
private void addTemplatedFile(
94+
File projectDir,
95+
String fileName,
96+
String groupId,
97+
String artifactId,
98+
File targetDir,
99+
String targetFileName) {
91100
try {
92-
var values = Map.of("groupId", groupId, "artifactId", artifactId,
93-
"artifactClassId", artifactClassId(artifactId),
94-
"josdkVersion", Versions.JOSDK,
95-
"fabric8Version", Versions.KUBERNETES_CLIENT);
101+
var values =
102+
Map.of(
103+
"groupId",
104+
groupId,
105+
"artifactId",
106+
artifactId,
107+
"artifactClassId",
108+
artifactClassId(artifactId),
109+
"josdkVersion",
110+
Versions.JOSDK,
111+
"fabric8Version",
112+
Versions.KUBERNETES_CLIENT);
96113

97114
var mustache = mustacheFactory.compile("templates/" + fileName);
98-
var targetFile = new File(targetDir == null ? projectDir : targetDir,
99-
targetFileName == null ? fileName : targetFileName);
115+
var targetFile =
116+
new File(
117+
targetDir == null ? projectDir : targetDir,
118+
targetFileName == null ? fileName : targetFileName);
100119
FileUtils.forceMkdir(targetFile.getParentFile());
101120
var writer = new FileWriter(targetFile);
102121
mustache.execute(writer, values);
@@ -114,8 +133,8 @@ private void addStaticFile(File targetDir, String fileName, String targetFileNam
114133
addStaticFile(targetDir, fileName, targetFileName, null);
115134
}
116135

117-
private void addStaticFile(File targetDir, String fileName, String targetFilename,
118-
String subDir) {
136+
private void addStaticFile(
137+
File targetDir, String fileName, String targetFilename, String subDir) {
119138
String sourcePath = subDir == null ? "/static/" : "/static/" + subDir;
120139
String path = sourcePath + fileName;
121140
try (var is = Bootstrapper.class.getResourceAsStream(path)) {
@@ -127,14 +146,12 @@ private void addStaticFile(File targetDir, String fileName, String targetFilenam
127146
} catch (IOException e) {
128147
throw new RuntimeException("File path: " + path, e);
129148
}
130-
131149
}
132150

133151
public static String artifactClassId(String artifactId) {
134152
var parts = artifactId.split("-");
135-
return Arrays.stream(parts).map(p -> p.substring(0, 1)
136-
.toUpperCase() + p.substring(1))
153+
return Arrays.stream(parts)
154+
.map(p -> p.substring(0, 1).toUpperCase() + p.substring(1))
137155
.collect(Collectors.joining(""));
138156
}
139-
140157
}

bootstrapper-maven-plugin/src/main/java/io/javaoperatorsdk/boostrapper/BootstrapperMojo.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@
88
import org.apache.maven.plugins.annotations.Parameter;
99

1010
@Mojo(name = "create", requiresProject = false)
11-
public class BootstrapperMojo
12-
extends AbstractMojo {
11+
public class BootstrapperMojo extends AbstractMojo {
1312

1413
@Parameter(defaultValue = "${projectGroupId}")
1514
protected String projectGroupId;
1615

1716
@Parameter(defaultValue = "${projectArtifactId}")
1817
protected String projectArtifactId;
1918

20-
public void execute()
21-
throws MojoExecutionException {
19+
public void execute() throws MojoExecutionException {
2220
String userDir = System.getProperty("user.dir");
2321
new Bootstrapper().create(new File(userDir), projectGroupId, projectArtifactId);
2422
}

0 commit comments

Comments
 (0)