Skip to content

Commit

Permalink
Use GOMAXPROCS for MaxConcurrentReconciles
Browse files Browse the repository at this point in the history
Update this to be consistent with our other controllers. I believe this
equates to 128, but setting this programmatically is probably the better
way to go.

Signed-off-by: Blake Devcich <[email protected]>
  • Loading branch information
bdevcich committed Nov 27, 2023
1 parent ec0020c commit 26bf60d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/controller/datamovement_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"path/filepath"
"reflect"
"regexp"
"runtime"
"strconv"
"strings"
"sync"
Expand Down Expand Up @@ -736,9 +737,10 @@ func filterByNamespace(namespace string) predicate.Predicate {

// SetupWithManager sets up the controller with the Manager.
func (r *DataMovementReconciler) SetupWithManager(mgr ctrl.Manager) error {
maxReconciles := runtime.GOMAXPROCS(0)
return ctrl.NewControllerManagedBy(mgr).
For(&nnfv1alpha1.NnfDataMovement{}).
WithOptions(controller.Options{MaxConcurrentReconciles: 128}).
WithOptions(controller.Options{MaxConcurrentReconciles: maxReconciles}).
WithEventFilter(filterByNamespace(r.WatchNamespace)).
Complete(r)
}

0 comments on commit 26bf60d

Please sign in to comment.