Skip to content

Commit

Permalink
Explicitly name controllers reconciling the same Kind (#118)
Browse files Browse the repository at this point in the history
  • Loading branch information
bastjan authored Aug 28, 2024
1 parent d62f585 commit a00c8e5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions controllers/zoneusageprofileapply_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{},
Expand Down
1 change: 1 addition & 0 deletions controllers/zoneusageprofilesync_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit a00c8e5

Please sign in to comment.