Skip to content
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

Refactor service binding controller #3576

Open
georgethebeatle opened this issue Oct 30, 2024 · 0 comments
Open

Refactor service binding controller #3576

georgethebeatle opened this issue Oct 30, 2024 · 0 comments

Comments

@georgethebeatle
Copy link
Member

Background

We have decided to have a single reconciler for bindings toboth managed and user-provided service instacnes. A cfservicebinding resource does not have a field indicating the type of its respective cfserviceinstance, menaninig that in order to tell one type of binding from the other one has to first look up the instance. Looking up the instance could return an error, making it impossible to implement an event filter that would distribute different types of bindings to different reconcilers (like we have done for instances). The event filter is based on a predicate function, but a predicate function cannot return an error.

We have created a single bindings controller that reconclies managed and user-provided bindings alike, but it looks up their respective instances and based on the type of instance it delegates to a sub-reconciler for any specific reconciliation logic for the respective type of binding.

So far the specific logic has been:

  • create the respective secret containing credentials
  • create the sericebinding.io resource so that these credentials are projected as a volume mount.

Everything else has been done by the main reconciler in a shared manner. However we have noticed that some conditional logic discerning managed from user-provided services has started to emerge in the main reconciler including

  • how we build the sericebinding.io binding
  • what do we do prior to removing the finalizer
  • what does it mean for the binding to be ready

Therefore it would make sense to remove those conditionals and split the logic between the specific sub-reconcilers, leaving only the dispatching based on the service instance type in the main reconciler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🇪🇺 To do
Development

No branches or pull requests

1 participant