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
AdviceReconciler #502
base: main
Are you sure you want to change the base?
AdviceReconciler #502
Conversation
Signed-off-by: Scott Andrews <scott@andrews.me>
cc @squeedee |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #502 +/- ##
==========================================
- Coverage 61.13% 60.43% -0.70%
==========================================
Files 28 30 +2
Lines 2583 2669 +86
==========================================
+ Hits 1579 1613 +34
- Misses 917 967 +50
- Partials 87 89 +2 ☔ View full report in Codecov by Sentry. |
_ SubReconciler[client.Object] = (*NullReconciler[client.Object])(nil) | ||
) | ||
|
||
// NullReconciler does nothing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question]: Is this for testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not just for testing. Since the Reconciler field is required, but Around can choose not to invoke a reconciler it's an easy way to define something that implements the interface, but does nothing.
Co-authored-by: Max Brauer <mamachanko@users.noreply.github.com> Signed-off-by: Scott Andrews <scott@andrews.me>
This is really great. I started at the Top level reconciler so it didn't occur to me that composable subreconcilers will work for everything else.. I guess a delegate with the same interface for the top level? |
…hookAdapter Signed-off-by: Scott Andrews <scott@andrews.me>
Signed-off-by: Scott Andrews <scott@andrews.me>
@yharish991 good catch, I refactored a bit to make sure this can't happen in the future. |
@scothis @yharish991 has been using this directly. We're finding this quite useful so far. Do you plan on moving it from "sketch" status? Personally. I think it's a good approach and will serve users well. |
A sketch of a potential method for defining advice for a SubReconciler as a SubReconciler. It can be composed manually into existing SubReconciler hierarchies. Other composition strategies could be explored in the future.
This does not address advice for ResourceReconciler, AggregateReconciler, or AdmissionWebhookAdapter.
Refs #500