From fd29a5a1c11371176dc5da8ead5a1639d9ade834 Mon Sep 17 00:00:00 2001 From: Francisco Javier Tirado Sarti Date: Tue, 5 Sep 2023 17:43:38 +0200 Subject: [PATCH] [KOGITO-9774] Registering kubernetes service loaders in native mode --- .../quarkus/kubernetes/KogitoAddOnKubernetesProcessor.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/quarkus/addons/kubernetes/deployment/src/main/java/org/kie/kogito/addons/quarkus/kubernetes/KogitoAddOnKubernetesProcessor.java b/quarkus/addons/kubernetes/deployment/src/main/java/org/kie/kogito/addons/quarkus/kubernetes/KogitoAddOnKubernetesProcessor.java index 1f953075630..fc2fe69c7fe 100644 --- a/quarkus/addons/kubernetes/deployment/src/main/java/org/kie/kogito/addons/quarkus/kubernetes/KogitoAddOnKubernetesProcessor.java +++ b/quarkus/addons/kubernetes/deployment/src/main/java/org/kie/kogito/addons/quarkus/kubernetes/KogitoAddOnKubernetesProcessor.java @@ -16,6 +16,7 @@ package org.kie.kogito.addons.quarkus.kubernetes; import org.jboss.logmanager.Level; +import org.kie.kogito.addons.k8s.resource.catalog.KubernetesServiceCatalog; import org.kie.kogito.addons.quarkus.k8s.EndpointCallerProducer; import org.kie.kogito.addons.quarkus.k8s.EndpointDiscoveryProducer; import org.kie.kogito.addons.quarkus.k8s.config.ServiceDiscoveryConfigBuilder; @@ -27,6 +28,7 @@ import io.quarkus.deployment.builditem.FeatureBuildItem; import io.quarkus.deployment.builditem.LogCategoryBuildItem; import io.quarkus.deployment.builditem.RunTimeConfigBuilderBuildItem; +import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; class KogitoAddOnKubernetesProcessor extends AnyEngineKogitoAddOnProcessor { @@ -62,4 +64,9 @@ void runtimeInitConfigBuilderProducer(BuildProducer categories) { categories.produce(new LogCategoryBuildItem("okhttp3.OkHttpClient", Level.WARN)); } + + @BuildStep + public ServiceProviderBuildItem nativeRegistration() { + return ServiceProviderBuildItem.allProvidersFromClassPath(KubernetesServiceCatalog.class.getCanonicalName()); + } }