Skip to content

Commit

Permalink
[JBPM-8624] - Removing EC Keys support from Kubernetes Client (apache#25
Browse files Browse the repository at this point in the history
)
  • Loading branch information
ricardozanini authored and mswiderski committed Jul 23, 2019
1 parent f245caf commit edcb09d
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
5 changes: 5 additions & 0 deletions kogito-cloud-services/kogito-cloud-kubernetes-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client</artifactId>
</dependency>
<dependency>
<groupId>com.oracle.substratevm</groupId>
<artifactId>svm</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <code>--allow-incomplete-classpath</code> option on their build configuration.
* <p/>
* Cloned from <a href="https://github.com/quarkusio/quarkus/blob/master/extensions/kubernetes-client/runtime/src/main/java/io/quarkus/kubernetes/client/runtime/graal/CertUtilsSubstitutions.java">Quarkus Kubernetes Extension</a> 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");
}

}

0 comments on commit edcb09d

Please sign in to comment.