Open prakashreddy-97 opened 3 days ago
You seem to be using an older version of the client (6.3.1). I also suspect that your project might also be using a third-party library or framework such as Spring, Quarkus, etc. that might also bring a newer (or older version of the client). Could you please confirm this?
Hey @manusa, Yes we are using the springboot framework(3.0.19), java version 17. We were using groovy for unit tests before upgrading to these versions and couldn't mock the kubernetes-client. Thats when we started using the jupiter-junit and still could not mock the kubernetes-client.
Are you using Spring Cloud Kubernetes too? Check if the Fabric8 Kubernetes Client is being imported transitively from one of those libraries. It's likely that you have a version convergence issue.
We are not using Spring Cloud Kubernetes, and there are no other dependencies that import kubernetes-client
Try to create a reproducer project then. The code you showed should be working with a standard Kubernetes Client project setup.
Ok, will try that and get back to you. Thank you
Describe the bug
Hello Team,
I am trying to use the @EnableKubernetesMockClient annotation to create a kubernetesClient in my test class which are in juupiter junit, but I am getting the following error.
NoClassDefFoundError io/fabric8/kubernetes/client/dsl/ServerSideApplicable
Fabric8 Kubernetes Client version
6.3.1
Steps to reproduce
import io.fabric8.kubernetes.client.KubernetesClient; import io.fabric8.kubernetes.client.server.mock.EnableKubernetesMockClient; import org.junit.jupiter.api.Test;
@EnableKubernetesMockClient class MyTest {
KubernetesClient client;
Code
}
Expected behavior
Would like to get a mocked value for kubernetsClient
Runtime
Kubernetes (vanilla)
Kubernetes API Server version
1.25.3@latest
Environment
Windows
Fabric8 Kubernetes Client Logs
No response
Additional context
No response