Skip to content

Commit

Permalink
Merge pull request #31833 from marcnuri-forks/fix/knative
Browse files Browse the repository at this point in the history
Knative deployer uses hasApiGroup to check for Knative support
  • Loading branch information
geoand authored Mar 14, 2023
2 parents 50c7638 + c542d57 commit 9daba4f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import java.util.List;
import java.util.Optional;

import io.fabric8.knative.client.DefaultKnativeClient;
import io.fabric8.knative.client.KnativeClient;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.kubernetes.client.spi.KubernetesClientBuildItem;
Expand All @@ -24,8 +24,8 @@ public void checkEnvironment(Optional<SelectedKubernetesDeploymentTargetBuildIte
return;
}
if (target.getEntry().getName().equals(KNATIVE)) {
try (DefaultKnativeClient client = kubernetesClientBuilder.buildClient().adapt(DefaultKnativeClient.class)) {
if (client.isSupported()) {
try (KnativeClient client = kubernetesClientBuilder.buildClient().adapt(KnativeClient.class)) {
if (client.hasApiGroup("knative.dev", false)) {
deploymentCluster.produce(new KubernetesDeploymentClusterBuildItem(KNATIVE));
} else {
throw new IllegalStateException(
Expand Down

0 comments on commit 9daba4f

Please sign in to comment.