-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Kubernetes clients all clash with one another #14943
Comments
/cc @geoand |
I kinda doubt anyone would want all types of clients around TBH. |
If you prefer, I can do it that way too, they should be interoperable and we can always switch behaviour later if required. |
Yeah, I think that would be the best first step |
That makes sense to me as well. |
That said, I'm wondering if it would be possible to somehow select the appropriate extension at build time so that people who don't target OpenShift only get the added dependencies if they need them… |
Quarkus doesn't auto-select extensions for users, so we can't do that. But the operator-sdk will get the right client no matter what extension the user uses now. |
The problem is that the sdk extension is dependent on the client extension. Which means that it needs to include the OpenShift extension and carry all the extra dependencies even when users don't target OpenShift. |
Can't you leave it up to the sdk users to include that extension? Oh, perhaps you need some actions to call only if it's an openshift client? |
If that's the case, I think you can make the dependency optional in the SDK, and it will only realise if the user depends on it too. |
I need to look into it but the sdk extension expects to be getting a client, though maybe decoupling both might be a cleaner solution… Not sure at this point. The idea of depending on the kubernetes-client-extension was so that we could expose a different configuration interface to the client, one that would be specific to the sdk and not expose Quarkus-specific properties. |
Fixes quarkusio#14943 (cherry picked from commit ada44ba)
When importing the
quarkus-openshift-client
extension, we get an injectableOpenShiftClient
which also extendsKubernetesClient
which is located in the transitive dependencyquarkus-kubernetes-client
, we get a CDI clash on anyKubernetesClient
injection points, because we now have two clients which implement it.We could fix this by disabling the producer of
KubernetesClient
if theOpenShiftClient
producer exists, but this won't scale for the other types of clients (there are 3 subtypes ofKubernetesClient
from 3 separate extensions that can all be imported).So I think the best is to restrict the produced type of
OpenShiftClient
so that it does not clash, and users can inject either type of client separately.The text was updated successfully, but these errors were encountered: