diff --git a/kogito-cloud-services/kogito-cloud-kubernetes-client/pom.xml b/kogito-cloud-services/kogito-cloud-kubernetes-client/pom.xml index 42374698d47..222359220fe 100644 --- a/kogito-cloud-services/kogito-cloud-kubernetes-client/pom.xml +++ b/kogito-cloud-services/kogito-cloud-kubernetes-client/pom.xml @@ -24,6 +24,11 @@ io.fabric8 kubernetes-client + + com.oracle.substratevm + svm + provided + org.junit.vintage junit-vintage-engine diff --git a/kogito-cloud-services/kogito-cloud-kubernetes-client/src/main/java/org/kie/kogito/cloud/kubernetes/client/graal/KubernetesClientCertUtilsSubstitutions.java b/kogito-cloud-services/kogito-cloud-kubernetes-client/src/main/java/org/kie/kogito/cloud/kubernetes/client/graal/KubernetesClientCertUtilsSubstitutions.java new file mode 100644 index 00000000000..871b7603b13 --- /dev/null +++ b/kogito-cloud-services/kogito-cloud-kubernetes-client/src/main/java/org/kie/kogito/cloud/kubernetes/client/graal/KubernetesClientCertUtilsSubstitutions.java @@ -0,0 +1,38 @@ +/* + * Copyright 2019 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.kie.kogito.cloud.kubernetes.client.graal; + +import java.io.IOException; +import java.io.InputStream; +import java.security.PrivateKey; + +import com.oracle.svm.core.annotate.Substitute; +import com.oracle.svm.core.annotate.TargetClass; + +/** + * Removes EC Keys support from Fabric8 Kubernetes client dependency on native binaries. + * This avoids clients to add --allow-incomplete-classpath option on their build configuration. + *

+ * Cloned from Quarkus Kubernetes Extension to not add Quarkus dependencies to this project + */ +@TargetClass(className = "io.fabric8.kubernetes.client.internal.CertUtils") +public final class KubernetesClientCertUtilsSubstitutions { + + @Substitute + static PrivateKey handleECKey(InputStream keyInputStream) throws IOException { + throw new RuntimeException("EC Keys are not supported when using the native binary"); + } + +}