reconcilerio / runtime

Kubernetes reconciler framework building on controller-runtime
https://reconciler.io/runtime
Apache License 2.0
25 stars 5 forks source link

Aspect Oriented Hooks #500

Open squeedee opened 8 months ago

squeedee commented 8 months ago

I would like a way to add start/end/around hooks to any reconciler or sub-reconciler object. My main use case for this is to add additional logging and add span data to the context for tracing. The injected methods would need access to the context (with the ability to provide a replacement in arounds )

squeedee commented 8 months ago

In my mind, the simplest mechanism is to add a [before|after|around]reconcile method to all the reconcilers and subreconciler's interfaces. I'm sure a general pointcut solution for callbacks such as ReflectChildStatus has possible benefits, but I don't know if there's any point in complicating the whole engine with "true" AOP?

squeedee commented 6 months ago

We love what you implemented in #502 but there's been no movement for 3 weeks. What can we do to get this over the line? CC @scothis

scothis commented 6 months ago

What's missing from that PR right now is tests and doc. I have a family obligation coming up, so it will be at least another week before I can fully finish it off. I don't expect the API shape to change much, so you can start building on it.