From 98f02aa969263f28f30613663bb628c929a681dd Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 7 Nov 2022 18:44:18 +0200 Subject: [PATCH] Register all implementation of ExtensionAdapter in k8s client extension Fixes: #29096 --- .../client/deployment/KubernetesClientProcessor.java | 4 ++++ .../client/deployment/OpenShiftClientProcessor.java | 9 --------- 2 files changed, 4 insertions(+), 9 deletions(-) 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 6b9d53288f207..d171af78abf74 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 @@ -29,6 +29,7 @@ import io.fabric8.kubernetes.client.DefaultKubernetesClient; import io.fabric8.kubernetes.client.VersionInfo; import io.fabric8.kubernetes.client.Watcher; +import io.fabric8.kubernetes.client.extension.ExtensionAdapter; import io.fabric8.kubernetes.client.http.HttpClient; import io.fabric8.kubernetes.client.impl.KubernetesClientImpl; import io.fabric8.kubernetes.internal.KubernetesDeserializer; @@ -222,6 +223,9 @@ public void process(ApplicationIndexBuildItem applicationIndex, CombinedIndexBui // Register the default HttpClient implementation serviceProviderProducer.produce(new ServiceProviderBuildItem( HttpClient.Factory.class.getName(), "io.fabric8.kubernetes.client.okhttp.OkHttpClientFactory")); + + serviceProviderProducer.produce(ServiceProviderBuildItem.allProvidersFromClassPath(ExtensionAdapter.class.getName())); + // Enable SSL support by default sslNativeSupport.produce(new ExtensionSslNativeSupportBuildItem(Feature.KUBERNETES_CLIENT)); } diff --git a/extensions/openshift-client/deployment/src/main/java/io/quarkus/openshift/client/deployment/OpenShiftClientProcessor.java b/extensions/openshift-client/deployment/src/main/java/io/quarkus/openshift/client/deployment/OpenShiftClientProcessor.java index 5541394ee691d..e979adea79a29 100644 --- a/extensions/openshift-client/deployment/src/main/java/io/quarkus/openshift/client/deployment/OpenShiftClientProcessor.java +++ b/extensions/openshift-client/deployment/src/main/java/io/quarkus/openshift/client/deployment/OpenShiftClientProcessor.java @@ -4,11 +4,8 @@ import org.jboss.jandex.DotName; -import io.fabric8.kubernetes.client.extension.ExtensionAdapter; import io.fabric8.openshift.client.DefaultOpenShiftClient; -import io.fabric8.openshift.client.impl.NamespacedOpenShiftExtensionAdapter; import io.fabric8.openshift.client.impl.OpenShiftClientImpl; -import io.fabric8.openshift.client.impl.OpenShiftExtensionAdapter; import io.quarkus.arc.deployment.AdditionalBeanBuildItem; import io.quarkus.arc.deployment.IgnoreSplitPackageBuildItem; import io.quarkus.deployment.Feature; @@ -58,12 +55,6 @@ public void process(BuildProducer reflectiveClasses, .produce(new ReflectiveClassBuildItem(true, true, OpenShiftClientImpl.class.getName())); reflectiveClasses .produce(new ReflectiveClassBuildItem(true, true, DefaultOpenShiftClient.class.getName())); - - // Register the default OpenShift ExtensionAdapter implementations - serviceProviderProducer.produce(new ServiceProviderBuildItem( - ExtensionAdapter.class.getName(), OpenShiftExtensionAdapter.class.getName())); - serviceProviderProducer.produce(new ServiceProviderBuildItem( - ExtensionAdapter.class.getName(), NamespacedOpenShiftExtensionAdapter.class.getName())); } @BuildStep