Skip to content

Commit 1074df9

Browse files
committed
perf: remove unnecessary 10s periodic requeue from controllers
- Remove RequeueAfter=10s from both Overcommit and OvercommitClass reconcilers to reduce unnecessary API server load - Rely on event-driven reconciliation (watches) which is the standard controller-runtime pattern for reacting to resource changes
1 parent 022a3b2 commit 1074df9

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

internal/controller/overcommit/overcommit_controller.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,8 @@ func (r *OvercommitReconciler) Reconcile(ctx context.Context, req ctrl.Request)
390390
// Don't fail the reconciliation for status update errors
391391
}
392392

393-
// Only requeue periodically for status checks, not immediately
394-
logger.Info("Reconciliation completed successfully", "nextReconcile", "10 seconds", "time", time.Now().Format("15:04:05"))
395-
return ctrl.Result{
396-
RequeueAfter: time.Second * 10,
397-
}, nil
393+
logger.Info("Reconciliation completed successfully", "time", time.Now().Format("15:04:05"))
394+
return ctrl.Result{}, nil
398395
}
399396

400397
// +kubebuilder:rbac:groups=apps, resources=deployments;replicasets,verbs=get;list;watch;create;update;patch;delete

internal/controller/overcommitclass/overcommitclass_controller.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,6 @@ func (r *OvercommitClassReconciler) Reconcile(ctx context.Context, req ctrl.Requ
393393
return ctrl.Result{}, err
394394
}
395395

396-
// Only requeue periodically for status checks, not immediately
397-
logger.Info("Reconciliation completed successfully", "nextReconcile", "10 seconds", "time", time.Now().Format("15:04:05"))
398-
return ctrl.Result{
399-
RequeueAfter: 10 * time.Second,
400-
}, nil
396+
logger.Info("Reconciliation completed successfully", "time", time.Now().Format("15:04:05"))
397+
return ctrl.Result{}, nil
401398
}

0 commit comments

Comments
 (0)