-
Notifications
You must be signed in to change notification settings - Fork 50
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
Exceptions in io.quarkiverse.operatorsdk.deployment.AddClusterRolesDecorator with QOSDK 6.8.0 #961
Comments
Looks like an issue with the decorator, indeed. |
The issue is that we've added support for generic kubernetes resources in the RBAC generator and to be able to know which resource is actually targeted, we have no choice (at this time) than instantiate the class to retrieve that information. We also leverage the instance to determine whether it uses SSA, which also can impact RBACs. However, we do so assuming a default, no-arg constructor (which, in hindsight, wasn't such a great idea). As this only impacts RBAC generation (which happens at build time), this shouldn't cause problems with your operator at runtime (unless, of course, the RBACs are deployed and not correct). |
Would it be OK with you to provide a no-arg constructor (even if it's not public) for this purpose? Or would that be a no-no? |
Thanks for the background information, I didn't look yet what the purpose of decorator is. We actually maintain the RBAC permission of the operator ourselves. We also don't deploy it into K8s for ITs (we do that in our Helm chart tests, where we the actual RBAC YAML is located). So I guess for us If we would need that feature, it would be a bit strange to have a no-args constructor, but we could manage. Those dependencies are not too hard to instantiate. But for now I'll just deactivate the feature. I would appreciate an improved error message though with less stack traces and more information what I have to do (a hint to the feature would already help, the info that it either needs a no-args constructor or can be disabled would be a bonus for the lazy ones). |
Indeed, this should be the solution for you.
Technically, I don't think that any of the dependencies would be needed in that situation unless they somehow get into play for the configuration of the dependent.
Yep, that was an oversight on our part. Sorry about that. |
Actually, if you're not using RBAC generation at all, you can also not include the |
Fixes #961 Signed-off-by: Chris Laprun <[email protected]>
Give the linked PR a try if you can and let me know if that addresses your issue. |
I'm just updating QOSDK from 6.7.3 to 6.8.0 and noticed these exceptions in the
AddClusterRolesDecorator
during aquarkusBuild
run.We get this for basically all of our dependent resources, because they use dependency injection in their constructors (which is supported to my knowledge).
For example, the resource from that stacktrace looks like this:
I would appreciate feedback if we're using DI in a wrong way or if this is a bug in the
AddClusterRolesDecorator
orUtils
class. This doesn't happen with QOSDK 6.7.3 (just double checked).Everything still seems to work though. The Quarkus build is successful and all of our tests are still green. The build window in IntelliJ just looks like the NCC-1701 on red alert.
The text was updated successfully, but these errors were encountered: