fabric8io / kubernetes-client

Java client for Kubernetes & OpenShift
http://fabric8.io
Apache License 2.0
3.38k stars 1.46k forks source link

Add Integration tests for Admission and Conversion Controllers written using KubernetesClient #3396

Open rohanKanojia opened 3 years ago

rohanKanojia commented 3 years ago

As suggested by @jorsol in https://github.com/fabric8io/kubernetes-client/pull/3363#issuecomment-892806386 , We should test admission and conversion webhooks written using Fabric8 Kubernetes Client. I'm not sure if anyone has done it yet in Java. We need to check if a user is able to write an admission controller using Fabric8 Kubernetes Client. You can check Kubernetes documentation[0] on how to do this.

If we're able to write one without any problems. We need to add integration tests for the following scenarios:

[0] https://kubernetes.io/blog/2019/03/21/a-guide-to-kubernetes-admission-controllers/

manusa commented 3 years ago

Relates to: #3388, https://github.com/fabric8io/kubernetes-client/issues/3336#issuecomment-896523954

jorsol commented 3 years ago

It's perfectly possible to write admission controllers and conversion webhooks using Fabric8 KC, but it requires having a Webhook REST API working in the app because the Kubernetes API server makes an HTTPS POST request to the given service and URL path.

So, one option I see is to just have an example with a framework like Quarkus to "test" this, anyway it should be possible to write an integration test but I'm not sure how much work would it require to have a proper integration in the actual itests module.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

aditya-32 commented 1 year ago

Hi @rohanKanojia i would like to take this up if no one is working on it.

manusa commented 6 months ago

I think that this should be possible now by leveraging the Kube API test module.

csviri commented 6 months ago

I think that this should be possible now by leveraging the Kube API test module.

Yes, this should be possible with this.

Also you might find this useful: https://github.com/operator-framework/josdk-webhooks