From 69b94a61e4f5fae120d27a210a7907e02ab25652 Mon Sep 17 00:00:00 2001 From: Kurt Hill Date: Wed, 20 Nov 2024 15:51:17 +0000 Subject: [PATCH 1/2] fix(server setup): Added MaxConcurrentReconciles to server manager setup --- internal/controller/compute/server/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/controller/compute/server/server.go b/internal/controller/compute/server/server.go index d9653741..77d82b79 100644 --- a/internal/controller/compute/server/server.go +++ b/internal/controller/compute/server/server.go @@ -55,7 +55,8 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error { return ctrl.NewControllerManagedBy(mgr). Named(name). WithOptions(controller.Options{ - RateLimiter: ratelimiter.NewController(), + MaxConcurrentReconciles: opts.CtrlOpts.MaxConcurrentReconciles, + RateLimiter: ratelimiter.NewController(), }). For(&v1alpha1.Server{}). Complete(managed.NewReconciler(mgr, From 5897b4dc48f9e9ab848a3439b540c1dabe1b905e Mon Sep 17 00:00:00 2001 From: Kurt Hill Date: Thu, 21 Nov 2024 09:28:59 +0000 Subject: [PATCH 2/2] fix(server.go): Use the CtrlOpts that use the flags initialised earlier --- internal/controller/compute/server/server.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/controller/compute/server/server.go b/internal/controller/compute/server/server.go index 77d82b79..cc88194b 100644 --- a/internal/controller/compute/server/server.go +++ b/internal/controller/compute/server/server.go @@ -27,13 +27,11 @@ import ( ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/controller-runtime/pkg/controller" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/logging" "github.com/crossplane/crossplane-runtime/pkg/meta" - "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" @@ -54,10 +52,7 @@ func Setup(mgr ctrl.Manager, opts *utils.ConfigurationOptions) error { return ctrl.NewControllerManagedBy(mgr). Named(name). - WithOptions(controller.Options{ - MaxConcurrentReconciles: opts.CtrlOpts.MaxConcurrentReconciles, - RateLimiter: ratelimiter.NewController(), - }). + WithOptions(opts.CtrlOpts.ForControllerRuntime()). For(&v1alpha1.Server{}). Complete(managed.NewReconciler(mgr, resource.ManagedKind(v1alpha1.ServerGroupVersionKind),