quarkus-operator-sdk icon indicating copy to clipboard operation
quarkus-operator-sdk copied to clipboard

Quarkus Test Kubernetes Client is incompatible with quarkus-operator-sdk.

Open hmadison opened this issue 2 years ago • 1 comments

When using version 6.2.0 of the quarkus-operator-sdk, the quarkus-test-kubernetes-client library no longer is able to act as a mock for the Kuberntes API server. To the best of my understanding, the switch to server side apply in version 4.4.0 of the java-operator-sdk is the source of the issue. The test client library does not appear to be able to emulate the server side apply behaviors necessary to let the operator sdk function.

A possible workaround is to set quarkus.kubernetes-client.devservices.enabled=false in your test application.properties file and use either jenvtest or Testcontainer's k3s support to validate the behavior of your operator.

hmadison avatar Jul 05 '23 11:07 hmadison

I think you mean set the property to true so that devservices are enabled and use this instead of the mock server. This is what the extension is actually doing (testing against a cluster brought up via Quarkus' Kubernetes devservice).

Personally speaking, I think that the mock server should eventually disappear as it's difficult to maintain and more or less would need to tend to a full re-implementation of the kubernetes APIs which is a losing proposition.

metacosm avatar Jul 05 '23 21:07 metacosm