-
Notifications
You must be signed in to change notification settings - Fork 0
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
Generic policy status reconciler #1
base: rlp-policy-status
Are you sure you want to change the base?
Generic policy status reconciler #1
Conversation
type ServiceProbeResult struct { | ||
} | ||
|
||
func (r *PolicyReconciler[T]) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) { |
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.
This is the generic Reconcile function that delegates the validation, reconciliation, and service probing and contains the common logic to update the status based on the result of these operations
return &p.Status.Conditions | ||
} | ||
|
||
type DummyPolicyReconciler struct { |
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.
An example of how a reconciler would look like using the generic policy reconciler
var relatedResource client.Object | ||
r.client.Get(ctx, types.NamespacedName{ | ||
Name: "dummy", | ||
}, relatedResource) |
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.
Doesn't actually do anything, this is just to prove that it is possible within the different stages to use the fields from the inner target ref reconciler
5863b25
to
ba26ec2
Compare
64b8232
to
6874ca6
Compare
POC of an experimental approach to a generic policy reconciler that sets the status using a template method pattern