Skip to content

Commit

Permalink
feat: Log start/end of reconciliation
Browse files Browse the repository at this point in the history
  • Loading branch information
hrak committed Aug 14, 2024
1 parent bc2002e commit 62b1d9c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions controllers/utils/base_reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,21 @@ func (r *ReconciliationRunner) RunReconciliationStages(fns ...CloudStackReconcil
return rslt, nil
}
}

r.Log.Info("Finished reconciliation",
"kind", r.ReconciliationSubject.GetObjectKind().GroupVersionKind().Kind,
"name", r.ReconciliationSubject.GetName())

return ctrl.Result{}, nil
}

// RunBaseReconciliationStages runs the base reconciliation stages which are to setup the logger, get the reconciliation
// subject, get CAPI and CloudStackClusters, and call either r.Reconcile or r.ReconcileDelete.
func (r *ReconciliationRunner) RunBaseReconciliationStages() (res ctrl.Result, retErr error) {
r.Log.Info("Starting reconciliation",
"kind", r.ReconciliationSubject.GetObjectKind().GroupVersionKind().Kind,
"name", r.ReconciliationSubject.GetName())

defer func() {
if r.Patcher != nil {
if err := r.Patcher.Patch(r.RequestCtx, r.ReconciliationSubject); err != nil {
Expand Down

0 comments on commit 62b1d9c

Please sign in to comment.