From a00c8e5384bd9e2fc477bd66e120e96a3fc71771 Mon Sep 17 00:00:00 2001 From: Sebastian Widmer Date: Wed, 28 Aug 2024 10:42:49 +0200 Subject: [PATCH] Explicitly name controllers reconciling the same Kind (#118) See https://github.com/kubernetes-sigs/controller-runtime/releases/tag/v0.19.0 breaking changes. --- controllers/zoneusageprofileapply_controller.go | 1 + controllers/zoneusageprofilesync_controller.go | 1 + 2 files changed, 2 insertions(+) diff --git a/controllers/zoneusageprofileapply_controller.go b/controllers/zoneusageprofileapply_controller.go index 5df70cb..7a5a658 100644 --- a/controllers/zoneusageprofileapply_controller.go +++ b/controllers/zoneusageprofileapply_controller.go @@ -187,6 +187,7 @@ func (r *ZoneUsageProfileApplyReconciler) SetupWithManager(mgr ctrl.Manager) err c, err := ctrl.NewControllerManagedBy(mgr). For(&cloudagentv1.ZoneUsageProfile{}). + Named("zoneusageprofiles_apply"). // Watch all namespaces and enqueue requests for all profiles on any change. Watches( &corev1.Namespace{}, diff --git a/controllers/zoneusageprofilesync_controller.go b/controllers/zoneusageprofilesync_controller.go index 2a58a00..8805dbb 100644 --- a/controllers/zoneusageprofilesync_controller.go +++ b/controllers/zoneusageprofilesync_controller.go @@ -67,6 +67,7 @@ func (r *ZoneUsageProfileSyncReconciler) Reconcile(ctx context.Context, req ctrl func (r *ZoneUsageProfileSyncReconciler) SetupWithManagerAndForeignCluster(mgr ctrl.Manager, foreign cluster.Cluster) error { return ctrl.NewControllerManagedBy(mgr). For(&cloudagentv1.ZoneUsageProfile{}). + Named("zoneusageprofiles_sync"). WatchesRawSource(source.Kind(foreign.GetCache(), &controlv1.UsageProfile{}, &handler.TypedEnqueueRequestForObject[*controlv1.UsageProfile]{})). Complete(r) }