Skip to content

Commit 2010c49

Browse files
authored
update to fabric8 7.1 and quarkus 3.18.1 (#319)
Signed-off-by: Attila Mészáros <[email protected]>
1 parent 19d58fd commit 2010c49

File tree

7 files changed

+152
-35
lines changed

7 files changed

+152
-35
lines changed

Diff for: core/src/main/java/io/javaoperatorsdk/webhook/admission/AdmissionUtils.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ public static AdmissionResponse notAllowedExceptionToAdmissionResponse(
3333

3434
public static KubernetesResource getTargetResource(AdmissionRequest admissionRequest,
3535
Operation operation) {
36-
return operation == Operation.DELETE ? admissionRequest.getOldObject()
37-
: admissionRequest.getObject();
36+
return (KubernetesResource) (operation == Operation.DELETE ? admissionRequest.getOldObject()
37+
: admissionRequest.getObject());
3838
}
3939

4040
public static AdmissionResponse admissionResponseFromMutation(KubernetesResource originalResource,

Diff for: pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
5252

5353
<junit.version>5.10.2</junit.version>
54-
<fabric8-client.version>6.13.4</fabric8-client.version>
54+
<fabric8-client.version>7.1.0</fabric8-client.version>
5555
<slf4j.version>1.7.36</slf4j.version>
5656
<log4j.version>2.24.3</log4j.version>
5757
<mokito.version>5.14.2</mokito.version>
@@ -73,7 +73,7 @@
7373
<maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
7474
<maven-source-plugin.version>3.3.1</maven-source-plugin.version>
7575
<spotless-maven-plugin.version>2.43.0</spotless-maven-plugin.version>
76-
<spring-boot-dependencies.version>3.4.1</spring-boot-dependencies.version>
76+
<spring-boot-dependencies.version>3.4.2</spring-boot-dependencies.version>
7777
</properties>
7878

7979
<dependencyManagement>

Diff for: samples/commons/pom.xml

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
<dependency>
4848
<groupId>org.junit.jupiter</groupId>
4949
<artifactId>junit-jupiter-api</artifactId>
50-
5150
<scope>test</scope>
5251
</dependency>
5352
</dependencies>

Diff for: samples/quarkus/pom.xml

+9-7
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1616
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
1717
<quarkus.platform.group-id>io.quarkus.platform</quarkus.platform.group-id>
18-
<quarkus.platform.version>3.11.0</quarkus.platform.version>
18+
<quarkus.platform.version>3.18.1</quarkus.platform.version>
1919
<skipITs>true</skipITs>
2020
<surefire-plugin.version>3.5.2</surefire-plugin.version>
2121
</properties>
@@ -43,6 +43,14 @@
4343
<groupId>io.quarkus</groupId>
4444
<artifactId>quarkus-arc</artifactId>
4545
</dependency>
46+
<dependency>
47+
<groupId>io.quarkus</groupId>
48+
<artifactId>quarkus-rest</artifactId>
49+
</dependency>
50+
<dependency>
51+
<groupId>io.quarkus</groupId>
52+
<artifactId>quarkus-rest-jackson</artifactId>
53+
</dependency>
4654
<dependency>
4755
<groupId>io.quarkus</groupId>
4856
<artifactId>quarkus-junit5</artifactId>
@@ -53,15 +61,10 @@
5361
<artifactId>quarkus-certmanager</artifactId>
5462
<version>1.0.3</version>
5563
</dependency>
56-
<dependency>
57-
<groupId>io.quarkus</groupId>
58-
<artifactId>quarkus-resteasy-reactive-jackson</artifactId>
59-
</dependency>
6064
<dependency>
6165
<groupId>io.quarkus</groupId>
6266
<artifactId>quarkus-minikube</artifactId>
6367
</dependency>
64-
6568
<dependency>
6669
<groupId>io.quarkus</groupId>
6770
<artifactId>quarkus-container-image-jib</artifactId>
@@ -71,7 +74,6 @@
7174
<artifactId>rest-assured</artifactId>
7275
<scope>test</scope>
7376
</dependency>
74-
7577
<dependency>
7678
<groupId>org.assertj</groupId>
7779
<artifactId>assertj-core</artifactId>

Diff for: samples/spring-boot/k8s/kubernetes.yml

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
annotations:
6+
app.dekorate.io/vcs-url: <<unknown>>
7+
labels:
8+
app.kubernetes.io/name: spring-boot-sample
9+
app.kubernetes.io/version: 1.1.7-SNAPSHOT
10+
name: spring-boot-sample
11+
spec:
12+
replicas: 1
13+
selector:
14+
matchLabels:
15+
app.kubernetes.io/name: spring-boot-sample
16+
app.kubernetes.io/version: 1.1.7-SNAPSHOT
17+
template:
18+
metadata:
19+
annotations:
20+
app.dekorate.io/vcs-url: <<unknown>>
21+
labels:
22+
app.kubernetes.io/name: spring-boot-sample
23+
app.kubernetes.io/version: 1.1.7-SNAPSHOT
24+
spec:
25+
containers:
26+
- env:
27+
- name: KUBERNETES_NAMESPACE
28+
valueFrom:
29+
fieldRef:
30+
fieldPath: metadata.namespace
31+
- name: SERVER_SSL_KEY_STORE
32+
value: /etc/certs/keystore.p12
33+
- name: SERVER_SSL_KEY_STORE_PASSWORD
34+
valueFrom:
35+
secretKeyRef:
36+
key: password
37+
name: pkcs12-pass
38+
image: test/spring-boot-sample:1.1.7-SNAPSHOT
39+
imagePullPolicy: IfNotPresent
40+
name: spring-boot-sample
41+
ports:
42+
- containerPort: 443
43+
name: http
44+
protocol: TCP
45+
volumeMounts:
46+
- mountPath: /etc/certs
47+
name: volume-certs
48+
readOnly: true
49+
volumes:
50+
- name: volume-certs
51+
secret:
52+
optional: false
53+
secretName: tls-secret
54+
---
55+
apiVersion: v1
56+
kind: Secret
57+
metadata:
58+
name: pkcs12-pass
59+
data:
60+
password: c3VwZXJzZWNyZXQ=
61+
type: Opaque
62+
---
63+
apiVersion: cert-manager.io/v1
64+
kind: Issuer
65+
metadata:
66+
annotations:
67+
app.dekorate.io/vcs-url: <<unknown>>
68+
labels:
69+
app.kubernetes.io/name: spring-boot-sample
70+
app.kubernetes.io/version: 1.1.7-SNAPSHOT
71+
name: spring-boot-sample
72+
spec:
73+
selfSigned: {}
74+
---
75+
apiVersion: v1
76+
kind: Service
77+
metadata:
78+
annotations:
79+
app.dekorate.io/vcs-url: <<unknown>>
80+
labels:
81+
app.kubernetes.io/name: spring-boot-sample
82+
app.kubernetes.io/version: 1.1.7-SNAPSHOT
83+
name: spring-boot-sample
84+
spec:
85+
ports:
86+
- name: http
87+
port: 443
88+
protocol: TCP
89+
targetPort: 443
90+
selector:
91+
app.kubernetes.io/name: spring-boot-sample
92+
app.kubernetes.io/version: 1.1.7-SNAPSHOT
93+
type: ClusterIP
94+
---
95+
apiVersion: cert-manager.io/v1
96+
kind: Certificate
97+
metadata:
98+
annotations:
99+
app.dekorate.io/vcs-url: <<unknown>>
100+
labels:
101+
app.kubernetes.io/name: spring-boot-sample
102+
app.kubernetes.io/version: 1.1.7-SNAPSHOT
103+
name: spring-boot-sample
104+
spec:
105+
dnsNames:
106+
- spring-boot-sample.default.svc
107+
- localhost
108+
duration: 7776000000000000ns
109+
encodeUsagesInRequest: false
110+
isCA: false
111+
issuerRef:
112+
name: spring-boot-sample
113+
keystores:
114+
pkcs12:
115+
create: true
116+
passwordSecretRef:
117+
key: password
118+
name: pkcs12-pass
119+
privateKey:
120+
algorithm: RSA
121+
encoding: PKCS8
122+
size: 2048
123+
renewBefore: 1296000000000000ns
124+
secretName: tls-secret
125+
subject:
126+
organizations:
127+
- Dekorate
128+
- Community
129+
usages:
130+
- server auth
131+
- client auth

Diff for: samples/spring-boot/pom.xml

+3-21
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<name>Kubernetes Webhooks Framework - Samples - Spring Boot</name>
1313

1414
<properties>
15-
<java.version>17</java.version>
1615
<jib-maven-plugin.version>3.4.4</jib-maven-plugin.version>
1716
<dekorate.version>4.1.4</dekorate.version>
1817
</properties>
@@ -80,26 +79,6 @@
8079
<type>test-jar</type>
8180
<scope>test</scope>
8281
</dependency>
83-
<dependency>
84-
<groupId>io.dekorate</groupId>
85-
<artifactId>kubernetes-spring-starter</artifactId>
86-
<version>${dekorate.version}</version>
87-
</dependency>
88-
<dependency>
89-
<groupId>io.dekorate</groupId>
90-
<artifactId>certmanager-annotations</artifactId>
91-
<version>${dekorate.version}</version>
92-
</dependency>
93-
<dependency>
94-
<groupId>io.dekorate</groupId>
95-
<artifactId>kubernetes-annotations</artifactId>
96-
<version>${dekorate.version}</version>
97-
</dependency>
98-
<dependency>
99-
<groupId>io.dekorate</groupId>
100-
<artifactId>jib-annotations</artifactId>
101-
<version>${dekorate.version}</version>
102-
</dependency>
10382
</dependencies>
10483

10584
<build>
@@ -109,6 +88,9 @@
10988
<artifactId>jib-maven-plugin</artifactId>
11089
<version>${jib-maven-plugin.version}</version>
11190
<configuration>
91+
<from>
92+
<image>eclipse-temurin:17-jre</image>
93+
</from>
11294
<to>
11395
<image>test/spring-boot-sample:${project.version}</image>
11496
</to>

Diff for: samples/spring-boot/src/test/java/io/javaoperatorsdk/webhook/sample/springboot/SpringBootWebhooksE2E.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import org.junit.jupiter.api.BeforeAll;
77

8+
import io.fabric8.kubernetes.client.ConfigBuilder;
89
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
910
import io.javaoperatorsdk.webhook.sample.AbstractEndToEndTest;
1011

@@ -15,12 +16,14 @@ class SpringBootWebhooksE2E extends AbstractEndToEndTest {
1516

1617
@BeforeAll
1718
static void deployService() throws IOException {
18-
try (var client = new KubernetesClientBuilder().build();
19+
try (var client = new KubernetesClientBuilder().withConfig(new ConfigBuilder()
20+
.withNamespace("default")
21+
.build()).build();
1922
var certManager = new URL(
2023
"https://github.com/cert-manager/cert-manager/releases/download/v1.10.1/cert-manager.yaml")
2124
.openStream()) {
2225
applyAndWait(client, certManager);
23-
applyAndWait(client, "target/classes/META-INF/dekorate/kubernetes.yml");
26+
applyAndWait(client, "k8s/kubernetes.yml");
2427
applyAndWait(client, "k8s/validating-webhook-configuration.yml");
2528
applyAndWait(client, "k8s/mutating-webhook-configuration.yml");
2629
applyAndWait(client,

0 commit comments

Comments
 (0)