Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Knative deployer client check always fails over missing KnativeExtensionAdapter #31787

Closed
michalvavrik opened this issue Mar 11, 2023 · 5 comments · Fixed by #31833
Closed

Knative deployer client check always fails over missing KnativeExtensionAdapter #31787

michalvavrik opened this issue Mar 11, 2023 · 5 comments · Fixed by #31833
Labels
area/kubernetes kind/bug Something isn't working
Milestone

Comments

@michalvavrik
Copy link
Contributor

michalvavrik commented Mar 11, 2023

Describe the bug

Using quarkus.kubernetes.deployment-target=knative always fails as matching adapter is missing. It's a regression as this was possible with 2.16.4.

Expected behavior

Works.

Actual behavior

Build fails with exception:

[ERROR] 	[error]: Build step io.quarkus.kubernetes.deployment.KnativeDeployer#checkEnvironment threw an exception: java.lang.IllegalStateException: No adapter available for type:class io.fabric8.knative.client.DefaultKnativeClient
[ERROR] 	at io.fabric8.kubernetes.client.impl.BaseClient.adapt(BaseClient.java:223)
[ERROR] 	at io.quarkus.kubernetes.deployment.KnativeDeployer.lambda$checkEnvironment$0(KnativeDeployer.java:32)
[ERROR] 	at java.base/java.util.Optional.ifPresent(Optional.java:178)
[ERROR] 	at io.quarkus.kubernetes.deployment.KnativeDeployer.checkEnvironment(KnativeDeployer.java:26)
[ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERROR] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[ERROR] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERROR] 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[ERROR] 	at io.quarkus.deployment.ExtensionLoader$3.execute(ExtensionLoader.java:909)
[ERROR] 	at io.quarkus.builder.BuildContext.run(BuildContext.java:282)
[ERROR] 	at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513)
[ERROR] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538)
[ERROR] 	at java.base/java.lang.Thread.run(Thread.java:833)
[ERROR] 	at org.jboss.threads.JBossThread.run(JBossThread.java:501)

How to Reproduce?

Steps to reproduce:

  1. oc new-project mvavrik-debug
  2. quarkus create app knative-reproducer -x openshift,resteasy-reactive --stream=3.0
  3. cd knative-reproducer/
  4. mvn clean verify -Dquarkus.platform.version=999-SNAPSHOT -Dquarkus.platform.group-id=io.quarkus -Dquarkus.kubernetes.deployment-target=knative -Dquarkus.kubernetes.deploy=true -Dquarkus.kubernetes-client.trust-certs=true -Dquarkus.container-image.registry=image-registry.openshift-image-registry.svc:5000

Optional steps:
5. I added Knative Client and it made no difference

<dependency>
    <groupId>io.fabric8</groupId>
    <artifactId>knative-client</artifactId>
</dependency>

Output of uname -a or ver

Linux

Output of java -version

No response

GraalVM version (if different from Java)

OpenJDK 64-Bit Server VM Temurin-17.0.5+8

Quarkus version or git rev

999-SNAPSHOT (commit 7909903) and 3.0.0.Alpha5

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6

Additional information

No response

@michalvavrik michalvavrik added the kind/bug Something isn't working label Mar 11, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 11, 2023

/cc @Sgitario (kubernetes), @geoand (knative,kubernetes,openshift), @iocanel (knative,kubernetes,openshift)

@Sgitario
Copy link
Contributor

This is a regression issue that starts happening in Alpha4 (it worked fine in Alpha3).
FYI @gsmet

I'm not sure if this is related to the new Kubernetes Client version: #30480
Or this issue was already there but it started failing after we removed the workaround to check the Knative environment in: #30743

What is odd is that the knative-client dependency seems to be there.

Any ideas? @manusa @geoand

@geoand
Copy link
Contributor

geoand commented Mar 14, 2023

Any ideas? @manusa @geoand

Not on my side

@manusa
Copy link
Contributor

manusa commented Mar 14, 2023

I think it might be related to the check removal. The best way would be to actually check if the cluster supports the specific resources that we're going to use.

Is there a test that verifies this? if so I can provide a PR to explore a possible fix.

@Sgitario
Copy link
Contributor

I think it might be related to the check removal. The best way would be to actually check if the cluster supports the specific resources that we're going to use.

Is there a test that verifies this? if so I can provide a PR to explore a possible fix.

There is no test that covers this scenario and we should add it (I will add one after I finish off some stuff). However, in the mean time, you can use the reproducer provided in the description:

  1. quarkus create app knative-reproducer -x kubernetes,container-image-jib,resteasy-reactive --stream=3.0
  2. cd knative-reproducer/
  3. mvn clean verify -Dquarkus.platform.version=999-SNAPSHOT -Dquarkus.platform.group-id=io.quarkus -Dquarkus.kubernetes.deployment-target=knative -Dquarkus.kubernetes.deploy=true

I've updated the reproducer to directly use the Kubernetes extension. I think it does not matter if you're connected to a K8s environment, because it fails before deploying the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants