mirror of
https://github.com/actions-runner-controller/actions-runner-controller.git
synced 2026-09-30 12:53:28 +02:00
Introduce cache for lookups of desired resource state, to reduce the amount of allocations in the controller (#4568)
This commit is contained in:
@@ -109,6 +109,7 @@ func (r *AutoscalingRunnerSetReconciler) Reconcile(ctx context.Context, req ctrl
|
||||
}
|
||||
|
||||
log.Info("Successfully removed finalizer after cleanup")
|
||||
r.ResourceCache.Delete(&autoscalingRunnerSet)
|
||||
return ctrl.Result{}, nil
|
||||
}
|
||||
|
||||
@@ -763,6 +764,7 @@ func (r *AutoscalingRunnerSetReconciler) deleteRunnerScaleSet(ctx context.Contex
|
||||
}
|
||||
|
||||
func (r *AutoscalingRunnerSetReconciler) createEphemeralRunnerSet(ctx context.Context, autoscalingRunnerSet *v1alpha1.AutoscalingRunnerSet, log logr.Logger) (ctrl.Result, error) {
|
||||
r.ResourceCache.ephemeralRunnerSet.Delete(autoscalingRunnerSet)
|
||||
desiredRunnerSet, err := r.newEphemeralRunnerSet(autoscalingRunnerSet)
|
||||
if err != nil {
|
||||
log.Error(err, "Could not create EphemeralRunnerSet")
|
||||
@@ -787,6 +789,7 @@ func (r *AutoscalingRunnerSetReconciler) createAutoScalingListenerForRunnerSet(c
|
||||
})
|
||||
}
|
||||
|
||||
r.ResourceCache.autoscalingListener.Delete(autoscalingRunnerSet)
|
||||
autoscalingListener, err := r.newAutoscalingListener(
|
||||
autoscalingRunnerSet,
|
||||
ephemeralRunnerSet,
|
||||
|
||||
Reference in New Issue
Block a user