Skip to content

Commit

Permalink
fix: update handler function signatures to use typed rate limiting in…
Browse files Browse the repository at this point in the history
…terface
  • Loading branch information
012xx committed Feb 18, 2025
1 parent b08bd38 commit cf21528
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controllers/namespace_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ func (r *NamespaceReconciler) reconcileTemplateNamespace(ctx context.Context, ns

// SetupWithManager sets up the controller with the Manager.
func (r *NamespaceReconciler) SetupWithManager(mgr ctrl.Manager) error {
subNSHandler := func(o client.Object, q workqueue.RateLimitingInterface) {
subNSHandler := func(o client.Object, q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
q.Add(reconcile.Request{NamespacedName: types.NamespacedName{
Name: o.GetName(),
}})
Expand All @@ -404,10 +404,10 @@ func (r *NamespaceReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&corev1.Namespace{}).
Watches(&accuratev2.SubNamespace{}, handler.Funcs{
CreateFunc: func(ctx context.Context, ev event.CreateEvent, q workqueue.RateLimitingInterface) {
CreateFunc: func(ctx context.Context, ev event.TypedCreateEvent[client.Object], q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
subNSHandler(ev.Object, q)
},
UpdateFunc: func(ctx context.Context, ev event.UpdateEvent, q workqueue.RateLimitingInterface) {
UpdateFunc: func(ctx context.Context, ev event.TypedUpdateEvent[client.Object], q workqueue.TypedRateLimitingInterface[reconcile.Request]) {
if ev.ObjectNew.GetDeletionTimestamp() != nil {
return
}
Expand Down

0 comments on commit cf21528

Please sign in to comment.