-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to create clients via api #3865
Comments
My personal preference would be for the single builder approach + adapt. I guess that this is the closest approach to what we already have. In addition to minimize breakages, it's an existent pattern, so some users should already know their way around it. I understand that the resulting scenarios would be:
|
The consideration behind a separate OpenShiftClientBuilder was to explicitly reference the OpenShiftConfig. |
It sounds like we'll keep just a single builder, and add a doc note about specific configs. The only danger is that the config must not be modified by the logic in the creation of the base client, otherwise the OpenShift specific nature of the config will be lost. Also AutoAdaptableKubernetesClient - should be deprecated (since it's in -client, it is by default) |
|
Is your enhancement related to a problem? Please describe
After #3654 DefaultKubernetesClient and DefaultOpenShiftClient ended up in their respective -client modules. So we need a way to construct clients via just the api.
Describe the solution you'd like
An initial proposal was 2d22886 - to introduce client specific builders.
They are using reflection - if that is not a good choice (for example for quarkus), we can switch to a service loader, or even do like slf4j and create/remove dummy classes in the api modules.
Whatever the outcome of this is, the highest level construct should be used to hold state for things like the Handlers - so that we can avoid static references.
Describe alternatives you've considered
Alternatives could include just a single client KubernetesClientBuilder:
new KubernetesClientBuilder().withConfig(...).build().adapt(OpenShiftClient.class)
Additional context
No response
The text was updated successfully, but these errors were encountered: