Skip to content

Commit

Permalink
Fix compilation failure due to removed method
Browse files Browse the repository at this point in the history
Fabric8 team removed[1][2] constructors, which we were using to create Openshift client
Switched to other methods.
This change was brought to Quarkus with this update[3]

[1] fabric8io/kubernetes-client@6d7db80#diff-92a1266d167b46838301a64f043de2895376ebf7ec810e7769d641d2fed6f511L227-L246
[2] fabric8io/kubernetes-client#4662
[3] quarkusio/quarkus#33767
  • Loading branch information
fedinskiy committed Jun 14, 2023
1 parent b7b638b commit 6db76a2
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import io.fabric8.kubernetes.api.model.VolumeMount;
import io.fabric8.kubernetes.api.model.VolumeMountBuilder;
import io.fabric8.kubernetes.client.CustomResource;
import io.fabric8.kubernetes.client.KubernetesClientBuilder;
import io.fabric8.kubernetes.client.dsl.ContainerResource;
import io.fabric8.kubernetes.client.dsl.PodResource;
import io.fabric8.kubernetes.client.utils.Serialization;
Expand All @@ -65,7 +66,6 @@
import io.fabric8.openshift.client.NamespacedOpenShiftClient;
import io.fabric8.openshift.client.OpenShiftConfig;
import io.fabric8.openshift.client.OpenShiftConfigBuilder;
import io.fabric8.openshift.client.impl.OpenShiftClientImpl;
import io.quarkus.test.bootstrap.Service;
import io.quarkus.test.configuration.PropertyLookup;
import io.quarkus.test.logging.Log;
Expand Down Expand Up @@ -108,16 +108,20 @@ private OpenShiftClient(String scenarioId) {
if (ENABLED_EPHEMERAL_NAMESPACES.getAsBoolean()) {
currentNamespace = createProject();
OpenShiftConfig config = new OpenShiftConfigBuilder().withTrustCerts(true).withNamespace(currentNamespace).build();
client = new OpenShiftClientImpl(config);
client = createClient(config);
} else {
OpenShiftConfig config = new OpenShiftConfigBuilder().withTrustCerts(true).build();
client = new OpenShiftClientImpl(config);
client = createClient(config);
currentNamespace = client.getNamespace();
}
isClientReady = true;
kn = client.adapt(KnativeClient.class);
}

private static NamespacedOpenShiftClient createClient(OpenShiftConfig config) {
return new KubernetesClientBuilder().withConfig(config).build().adapt(NamespacedOpenShiftClient.class);
}

public static OpenShiftClient create(String scenarioId) {
return new OpenShiftClient(scenarioId);
}
Expand Down

0 comments on commit 6db76a2

Please sign in to comment.