Skip to content

Allow for multiple controllers reconciling same resource type but with different labels #2228

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

Closed
goldmann opened this issue Feb 2, 2024 · 1 comment · Fixed by #2229
Closed
Milestone

Comments

@goldmann
Copy link

goldmann commented Feb 2, 2024

Bug Report

I have a use case where it would be great to have trow (or more) controllers being able to reconcile the same resource type.

Let's imaging we have a ConfigMap and controller X and Y. Depending on the "type" of the ConfigMap we would like to have applied different reconciliation workflows.

Having to squeeze it in a single controller would be pretty complicated and unnecessary. Instead we could just mark the ConfigMap with a proper label and the use labelSelector on the @ControllerConfiguration annotation so that the resource is picked up by correct controller.

Currently it doesn't work:

Caused by: io.javaoperatorsdk.operator.OperatorException: Cannot register controller 'generationrequestreconciler': another controller named 'operationgenerationrequestreconciler' is already registered for resource 'configmaps/v1'

What did you do?

What did you expect to see?

What did you see instead? Under which circumstances?

Environment

qosdk 6.6.0, quarkus: 3.7.0, josdk: 4.7.0

JDK 17

Possible Solution

Additional context

@csviri
Copy link
Collaborator

csviri commented Feb 2, 2024

As discussed this is a know limitation for now (not really a bug :) ), but will implement it since this is a valid use case.

@csviri csviri added this to the 4.8 milestone Feb 2, 2024
@csviri csviri linked a pull request Feb 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants