diff --git a/extensions/kubernetes-client/deployment/src/main/java/io/quarkus/kubernetes/client/deployment/KubernetesClientProcessor.java b/extensions/kubernetes-client/deployment/src/main/java/io/quarkus/kubernetes/client/deployment/KubernetesClientProcessor.java index c6f33d37f2e6c..c0041153ce1cd 100644 --- a/extensions/kubernetes-client/deployment/src/main/java/io/quarkus/kubernetes/client/deployment/KubernetesClientProcessor.java +++ b/extensions/kubernetes-client/deployment/src/main/java/io/quarkus/kubernetes/client/deployment/KubernetesClientProcessor.java @@ -142,6 +142,8 @@ public void process(ApplicationIndexBuildItem applicationIndex, CombinedIndexBui .produce(new ReflectiveClassBuildItem(true, false, "io.fabric8.kubernetes.api.model.IntOrString")); reflectiveClasses .produce(new ReflectiveClassBuildItem(true, false, "io.fabric8.kubernetes.internal.KubernetesDeserializer")); + reflectiveClasses + .produce(new ReflectiveClassBuildItem(true, true, "io.fabric8.kubernetes.client.VersionInfo")); if (log.isDebugEnabled()) { final String watchedClassNames = watchedClasses diff --git a/integration-tests/kubernetes-client/src/main/java/io/quarkus/it/kubernetes/client/Version.java b/integration-tests/kubernetes-client/src/main/java/io/quarkus/it/kubernetes/client/Version.java new file mode 100644 index 0000000000000..f77572e86ca21 --- /dev/null +++ b/integration-tests/kubernetes-client/src/main/java/io/quarkus/it/kubernetes/client/Version.java @@ -0,0 +1,22 @@ +package io.quarkus.it.kubernetes.client; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.core.Response; + +import io.fabric8.kubernetes.client.KubernetesClient; + +@Path("/version") +public class Version { + + private final KubernetesClient kubernetesClient; + + public Version(KubernetesClient kubernetesClient) { + this.kubernetesClient = kubernetesClient; + } + + @GET + public Response version() { + return Response.ok(kubernetesClient.getKubernetesVersion().getPlatform()).build(); + } +} diff --git a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/KubernetesClientTest.java b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/KubernetesClientTest.java index eb77afee422fa..d2b67f4e1b958 100644 --- a/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/KubernetesClientTest.java +++ b/integration-tests/kubernetes-client/src/test/java/io/quarkus/it/kubernetes/client/KubernetesClientTest.java @@ -48,6 +48,9 @@ public void testInteractionWithAPIServer() { RestAssured.when().post("/pod/test").then() .body(containsString("54321")); + + RestAssured.when().get("/version").then() + .statusCode(200); } @Test