Skip to content

Commit

Permalink
feat(main): Concurrent num default is 1 (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
cuisongliu authored Jan 15, 2022
1 parent d012ad7 commit 9d44852
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/cache"
"sigs.k8s.io/controller-runtime/pkg/client"
runtimecontroller "sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/controller-runtime/pkg/handler"
"sigs.k8s.io/controller-runtime/pkg/log"
"sigs.k8s.io/controller-runtime/pkg/source"
Expand Down Expand Up @@ -85,7 +86,7 @@ func (c *Reconciler) SetupWithManager(mgr ctrl.Manager) error {
c.Logger.V(4).Info("init reconcile controller service")
owner := &handler.EnqueueRequestForOwner{OwnerType: &v1beta1.ClusterEndpoint{}, IsController: false}
return ctrl.NewControllerManagedBy(mgr).WithEventFilter(&ResourceChangedPredicate{}).
Watches(&source.Kind{Type: &corev1.Service{}}, owner).
Watches(&source.Kind{Type: &corev1.Service{}}, owner).WithOptions(runtimecontroller.Options{MaxConcurrentReconciles: 1}).
For(&v1beta1.ClusterEndpoint{}).Complete(c)
}

Expand Down

0 comments on commit 9d44852

Please sign in to comment.