From e876b8b9689b60d636c0617c29a380455e68609b Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Mon, 26 Aug 2024 10:53:47 -0700 Subject: [PATCH] fix compilation errors after importing controller-runtime v0.19.0 Signed-off-by: Tariq Ibrahim --- controllers/clusterpolicy_controller.go | 3 ++- controllers/nvidiadriver_controller.go | 2 +- controllers/upgrade_controller.go | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/controllers/clusterpolicy_controller.go b/controllers/clusterpolicy_controller.go index a3429c7da..11064efa2 100644 --- a/controllers/clusterpolicy_controller.go +++ b/controllers/clusterpolicy_controller.go @@ -354,7 +354,8 @@ func addWatchNewGPUNode(r *ClusterPolicyReconciler, c controller.Controller, mgr // SetupWithManager sets up the controller with the Manager. func (r *ClusterPolicyReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error { // Create a new controller - c, err := controller.New("clusterpolicy-controller", mgr, controller.Options{Reconciler: r, MaxConcurrentReconciles: 1, RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(minDelayCR, maxDelayCR)}) + c, err := controller.New("clusterpolicy-controller", mgr, controller.Options{Reconciler: r, MaxConcurrentReconciles: 1, + RateLimiter: workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](minDelayCR, maxDelayCR)}) if err != nil { return err } diff --git a/controllers/nvidiadriver_controller.go b/controllers/nvidiadriver_controller.go index 829dcff6b..90734b143 100644 --- a/controllers/nvidiadriver_controller.go +++ b/controllers/nvidiadriver_controller.go @@ -256,7 +256,7 @@ func (r *NVIDIADriverReconciler) SetupWithManager(ctx context.Context, mgr ctrl. c, err := controller.New("nvidia-driver-controller", mgr, controller.Options{ Reconciler: r, MaxConcurrentReconciles: 1, - RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(minDelayCR, maxDelayCR), + RateLimiter: workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](minDelayCR, maxDelayCR), }) if err != nil { return err diff --git a/controllers/upgrade_controller.go b/controllers/upgrade_controller.go index 2995d3563..0c6de580d 100644 --- a/controllers/upgrade_controller.go +++ b/controllers/upgrade_controller.go @@ -232,7 +232,8 @@ func (r *UpgradeReconciler) removeNodeUpgradeStateLabels(ctx context.Context) er //nolint:dupl func (r *UpgradeReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager) error { // Create a new controller - c, err := controller.New("upgrade-controller", mgr, controller.Options{Reconciler: r, MaxConcurrentReconciles: 1, RateLimiter: workqueue.NewItemExponentialFailureRateLimiter(minDelayCR, maxDelayCR)}) + c, err := controller.New("upgrade-controller", mgr, controller.Options{Reconciler: r, MaxConcurrentReconciles: 1, + RateLimiter: workqueue.NewTypedItemExponentialFailureRateLimiter[reconcile.Request](minDelayCR, maxDelayCR)}) if err != nil { return err }