Skip to content

Commit 90dad53

Browse files
authored
chore: fabric8 version 6.5.1 (#72)
1 parent 59690a3 commit 90dad53

File tree

4 files changed

+50
-28
lines changed

4 files changed

+50
-28
lines changed

Diff for: pom.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@
4040
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
4141

4242
<junit.version>5.9.2</junit.version>
43-
<fabric8-client.version>6.2.0</fabric8-client.version>
43+
<fabric8-client.version>6.5.1</fabric8-client.version>
4444
<slf4j.version>1.7.32</slf4j.version>
4545
<log4j.version>2.17.1</log4j.version>
4646
<mokito.version>5.2.0</mokito.version>
47+
<mokito.version>5.2.0</mokito.version>
48+
<dekorate.version>3.5.2</dekorate.version>
4749
<commons-lang3.version>3.12.0</commons-lang3.version>
4850
<auto-service.version>1.0.1</auto-service.version>
4951
<assertj.version>3.21.0</assertj.version>
@@ -64,7 +66,6 @@
6466
<maven-gpg-plugin.version>3.0.1</maven-gpg-plugin.version>
6567
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
6668
<spring-boot-dependencies.version>2.7.3</spring-boot-dependencies.version>
67-
<dekorate.version>3.1.2</dekorate.version>
6869
</properties>
6970

7071
<modules>

Diff for: samples/commons/src/main/java/io/javaoperatorsdk/webhook/sample/commons/Utils.java

+11-6
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,21 @@ public static void applyAndWait(KubernetesClient client, InputStream is) {
3939
applyAndWait(client, is, null);
4040
}
4141

42-
public static void applyAndWait(KubernetesClient client, InputStream is,
43-
UnaryOperator<HasMetadata> transfor) {
44-
var resources = client.load(is).get();
45-
if (transfor != null) {
46-
resources = resources.stream().map(transfor).collect(Collectors.toList());
42+
public static void applyAndWait(KubernetesClient client, List<HasMetadata> resources,
43+
UnaryOperator<HasMetadata> transformer) {
44+
if (transformer != null) {
45+
resources = resources.stream().map(transformer).collect(Collectors.toList());
4746
}
48-
client.resourceList(resources).createOrReplace();
47+
client.resourceList(resources).create();
4948
client.resourceList(resources).waitUntilReady(3, TimeUnit.MINUTES);
5049
}
5150

51+
public static void applyAndWait(KubernetesClient client, InputStream is,
52+
UnaryOperator<HasMetadata> transformer) {
53+
var resources = client.load(is).items();
54+
applyAndWait(client, resources, transformer);
55+
}
56+
5257
public static void addRequiredLabels(Ingress ingress) {
5358
ingress.getMetadata().setLabels(Map.of(VALIDATION_TARGET_LABEL, "val"));
5459
}

Diff for: samples/quarkus/src/test/java/io/javaoperatorsdk/webhook/sample/QuarkusWebhooksE2E.java

+24-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
package io.javaoperatorsdk.webhook.sample;
22

3-
import java.io.IOException;
4-
import java.io.InputStream;
3+
import java.io.*;
54
import java.net.URL;
5+
import java.util.function.UnaryOperator;
66

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

9+
import io.fabric8.kubernetes.api.model.HasMetadata;
910
import io.fabric8.kubernetes.client.KubernetesClient;
1011
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
12+
import io.javaoperatorsdk.webhook.sample.commons.Utils;
1113

1214
import static io.javaoperatorsdk.webhook.sample.commons.Utils.addConversionHookEndpointToCustomResource;
1315
import static io.javaoperatorsdk.webhook.sample.commons.Utils.applyAndWait;
@@ -32,4 +34,24 @@ static void deployService() throws IOException {
3234
}
3335
}
3436

37+
// quarkus support uses an older version, these should be removed if quarkus will support newer
38+
// version of fabric8
39+
private static void applyAndWait(KubernetesClient client, InputStream is) {
40+
var resources = client.load(is).get();
41+
Utils.applyAndWait(client, resources, null);
42+
}
43+
44+
private static void applyAndWait(KubernetesClient client, String file) {
45+
applyAndWait(client, file, null);
46+
}
47+
48+
private static void applyAndWait(KubernetesClient client, String file,
49+
UnaryOperator<HasMetadata> transformer) {
50+
try (var fis = new FileInputStream(file)) {
51+
var resources = client.load(fis).get();
52+
Utils.applyAndWait(client, resources, transformer);
53+
} catch (IOException e) {
54+
throw new IllegalStateException(e);
55+
}
56+
}
3557
}

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

+12-18
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,6 @@
4949
<artifactId>reactor-test</artifactId>
5050
<scope>test</scope>
5151
</dependency>
52-
<dependency>
53-
<groupId>io.dekorate</groupId>
54-
<artifactId>kubernetes-spring-starter</artifactId>
55-
</dependency>
56-
<dependency>
57-
<groupId>io.dekorate</groupId>
58-
<artifactId>certmanager-annotations</artifactId>
59-
</dependency>
60-
<dependency>
61-
<groupId>io.dekorate</groupId>
62-
<artifactId>jib-annotations</artifactId>
63-
</dependency>
6452
<dependency>
6553
<groupId>io.javaoperatorsdk</groupId>
6654
<artifactId>kubernetes-webhooks-framework-core</artifactId>
@@ -84,15 +72,21 @@
8472
<groupId>io.javaoperatorsdk.admissioncontroller.sample</groupId>
8573
<artifactId>sample-commons</artifactId>
8674
<version>${project.version}</version>
87-
<exclusions>
88-
<exclusion>
89-
<artifactId>kubernetes-client</artifactId>
90-
<groupId>io.fabric8</groupId>
91-
</exclusion>
92-
</exclusions>
9375
<type>test-jar</type>
9476
<scope>test</scope>
9577
</dependency>
78+
<dependency>
79+
<groupId>io.dekorate</groupId>
80+
<artifactId>kubernetes-spring-starter</artifactId>
81+
</dependency>
82+
<dependency>
83+
<groupId>io.dekorate</groupId>
84+
<artifactId>certmanager-annotations</artifactId>
85+
</dependency>
86+
<dependency>
87+
<groupId>io.dekorate</groupId>
88+
<artifactId>jib-annotations</artifactId>
89+
</dependency>
9690
</dependencies>
9791

9892
<build>

0 commit comments

Comments
 (0)