crossplane-runtime icon indicating copy to clipboard operation
crossplane-runtime copied to clipboard

ManagedReconciler could be used as a general purpose reconciler

Open soorena776 opened this issue 4 years ago • 2 comments

What observation are you making?

The managed reconciler provides a rich set of functionalities and features that saves the developer from an extensive amount of boiler-plate code. In particular, the break-down of operations into 4 distinct categories could be extended to a lot of reconcilers, not necessarily the ones that are managing an external resource. I have personally found this pattern much more intuitive when writing new reconcilers (even when it's not managing an external cloud resource), as it provides a nice logical scaffolding for the resource reconciliation , and leaving the rest to be taken care of by the managed reconciler (e.g. deletion timestamp handling, status update, etc...).

Do you have any suggestions?

I suggest to remove the assumption that the library only can be used for external cloud resources. I think the current ExternalClient interface could be generalized and renamed to something like ResourceDriver, which provides the same interface. Some other limitations (for instance https://github.com/crossplane/crossplane-runtime/issues/101) could be also lifted.

soorena776 avatar Mar 30 '20 01:03 soorena776

I like this idea in principle, but it might be a a little difficult to implement. Presumably we do get some benefits from the managed reconciler logic assuming it's reconciling crossplane managed resources; i.e. expecting the resources being managed to have certain fields and satisfy a certain interface.

Perhaps it would be possible to nest these concerns? Something like managed.Reconciler that extends a more generic resource.Reconciler?

negz avatar Apr 03 '20 01:04 negz

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 13 '22 07:08 stale[bot]

Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as stale because it has had no activity in the last 90 days. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh will mark this issue as not stale.

github-actions[bot] avatar Sep 05 '24 01:09 github-actions[bot]