@@ -46,6 +46,7 @@ import (
4646// TODO: allow some timeout feature, such that component will go into error state if not ready within the given timeout
4747// (e.g. through a TimeoutConfiguration interface that components could optionally implement)
4848// TODO: from time to time, enforce dependent updates even if digest is matching
49+ // (this might require a lastAppliedAt timestamp per inventory item)
4950// TODO: run admission webhooks (if present) in reconcile (e.g. as post-read hook)
5051// TODO: improve overall log output
5152
@@ -157,6 +158,7 @@ func (r *Reconciler[T]) Reconcile(ctx context.Context, req ctrl.Request) (result
157158 }
158159 return ctrl.Result {}, errors .Wrap (err , "unexpected get error" )
159160 }
161+ // TODO: popuplate component's TypeMeta
160162
161163 // convenience accessors
162164 status := component .GetStatus ()
@@ -240,8 +242,11 @@ func (r *Reconciler[T]) Reconcile(ctx context.Context, req ctrl.Request) (result
240242
241243 // run post-read hooks
242244 // note: it's important that this happens after deferring the status handler
245+ // TODO: enhance ctx with tailored logger and event recorder
246+ // TODO: enhance ctx with the local client
247+ hookCtx := newContext (ctx ).WithReconcilerName (r .name )
243248 for hookOrder , hook := range r .postReadHooks {
244- if err := hook (ctx , r .client , component ); err != nil {
249+ if err := hook (hookCtx , r .client , component ); err != nil {
245250 return ctrl.Result {}, errors .Wrapf (err , "error running post-read hook (%d)" , hookOrder )
246251 }
247252 }
@@ -257,7 +262,9 @@ func (r *Reconciler[T]) Reconcile(ctx context.Context, req ctrl.Request) (result
257262 UpdatePolicy : r .options .UpdatePolicy ,
258263 StatusAnalyzer : r .statusAnalyzer ,
259264 })
260- hookCtx := newContext (ctx ).WithClient (targetClient )
265+ // TODO: enhance ctx with tailored logger and event recorder
266+ // TODO: enhance ctx with the local client
267+ hookCtx = newContext (ctx ).WithReconcilerName (r .name ).WithClient (targetClient )
261268
262269 // do the reconciliation
263270 if component .GetDeletionTimestamp ().IsZero () {
0 commit comments