quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.65k stars 2.64k forks source link

`@WithKubernetesTestServer` integration with `PodWatcher` #20038

Closed kenfinnigan closed 1 year ago

kenfinnigan commented 3 years ago

Description

I'm not sure if this would be a Quarkus thing or a fabric8 Kubernetes client thing but raising here first.

When using @WithKubernetesTestServer it would be great if it was possible to more realistically simulate the environment in tests, particularly in relation to PodWatcher.

If I have some Quarkus code that defines a PodWatcher, it would be fantastic if I could add a pod to the mock server:

mockServer.getClient().pods().create(pod1)

and have that trigger PodWatcher.eventReceived()!

I have no knowledge of how the mocking is implemented to know whether this is even feasibly achievable, but I think it would be cool

Implementation ideas

No response

quarkus-bot[bot] commented 3 years ago

/cc @geoand, @iocanel

geoand commented 3 years ago

Great idea!

Is there something we can do in Quarkus about this @iocanel or would this capability be added upstream?

geoand commented 3 years ago

cc @metacosm

iocanel commented 2 years ago

Great idea!

Is there something we can do in Quarkus about this @iocanel or would this capability be added upstream?

AFAIR, the mock server does expose websocket related operation, so it is technically possible to use it to support watchers etc.

Sgitario commented 1 year ago

I tried to use the Kubernetes Server mock and this is now working as expected (the client is watching the pods and receiving events from the Kubernetes server mock).

I guess this has been fixed in Fabric8 Kubernetes Client, but I can't tell which version.