kubernetes-client/java

SharedInformerFactory, but for proto

codefromthecrypt opened this issue · 3 comments

It seems that the SharedInformerFactory is designed for the openapi client, with the CallGenerator returning an okhttp3.Call.

ProtoClient doesn't seem designed in way to hook in the same way, at least at the moment, as it doesn't return okhttp3.Call. Rather, it invokes a request synchronously which wouldn't work with watches.

I'm not sure would be natural for it to return io.kubernetes.client.openapi.ApiException from generate, but that could be fine since ProtoClient depends on the openapi generated ApiClient anyway.

I think it could be something we can rejig to make it happen, by changing SharedInformerFactory or extracting some base class from it. This wouldn't unhook the gson dependency as still ApiClient pins it, but it could be possible to still use the proto infrastructure and drive informers more efficiently.

Happy to have work done here. As expressed elsewhere, ProtoClient was hacked together a long time ago (before SharedInformerFactory, fwiw) and then has mostly lain dormant.