eclipse-jkube / jkube

Build and Deploy java applications on Kubernetes
https://www.eclipse.dev/jkube/
Eclipse Public License 2.0
773 stars 518 forks source link

Update change in `kubernetesClient.customResource` in spring-boot-crd Quickstart #1985

Closed Prathamkrishna closed 1 year ago

Prathamkrishna commented 1 year ago

Describe the bug

Running the spring-boot-crd project throws an error of Kubernetes not found. mvn version: 3.8.6 minikube version: 1.37.1

Eclipse JKube version

1.10.0

Component

Kubernetes Maven Plugin

Apache Maven version

other (please specify in additional context)

Gradle version

None

Steps to reproduce

run mvn spring-boot:run once you move into the project.

Expected behavior

The project has to run.

Runtime

Kubernetes (vanilla), minikube

Kubernetes API Server version

other (please specify in additional context)

Environment

macOS

Eclipse JKube Logs

ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project spring-boot-crd: Compilation failure
[ERROR] {path-to-project}/jkube/quickstarts/maven/spring-boot-crd/src/main/java/org/eclipse/jkube/quickstart/springboot/crd/FrameworkResource.java:[41,56] cannot find symbol
[ERROR]   symbol:   method customResource(io.fabric8.kubernetes.client.dsl.base.CustomResourceDefinitionContext)
[ERROR]   location: variable kubernetesClient of type io.fabric8.kubernetes.client.KubernetesClient

Sample Reproducer Project

No response

Additional context

No response

rohanKanojia commented 1 year ago

The quickstart seems to get kubernetes-client dependency from kubernetes-maven-plugin. We upgrade to 6.x version which dropped customResource(context) DSL method. We need to use genericKubernetesResources() DSL method instead

rohanKanojia commented 1 year ago

Gradle equivalent quickstart doesn't seem to be affected by this since it's explicitly importing kubernetes-client dependency:

https://github.com/eclipse/jkube/blob/8078bdc3f220ba8a9ccbf448e22f192b23a47a31/quickstarts/gradle/spring-boot-crd/build.gradle#L21

However, we should think about updating in there as well (maybe in a separate issue)