Skip to content

Commit

Permalink
Review changes
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Gershkovich <elenage@il.ibm.com>
  • Loading branch information
ELENAGER committed Jan 11, 2024
1 parent 716217b commit 4d99c40
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions controllers/drcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,11 @@ func (r *DRClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {

return ctrl.NewControllerManagedBy(mgr).
For(&ramen.DRCluster{}).
Watches(&source.Kind{Type: &corev1.ConfigMap{}}, handler.EnqueueRequestsFromMapFunc(r.drClusterConfigMapMapFunc)).
Watches(&source.Kind{Type: &ramen.DRPlacementControl{}}, drpcMapFun, builder.WithPredicates(drpcPred())).
Watches(&source.Kind{Type: &ocmworkv1.ManifestWork{}}, mwMapFun, builder.WithPredicates(mwPred)).
Watches(&source.Kind{Type: &viewv1beta1.ManagedClusterView{}}, mcvMapFun, builder.WithPredicates(mcvPred)).
Watches(&source.Kind{Type: &corev1.Secret{}},
handler.EnqueueRequestsFromMapFunc(r.drClusterSecretMapFunc),
Watches(&source.Kind{Type: &corev1.ConfigMap{}}, handler.EnqueueRequestsFromMapFunc(r.drClusterConfigMapMapFunc)).
Watches(&source.Kind{Type: &corev1.Secret{}}, handler.EnqueueRequestsFromMapFunc(r.drClusterSecretMapFunc),
builder.WithPredicates(util.CreateOrDeleteOrResourceVersionUpdatePredicate{}),
).
Complete(r)
Expand Down Expand Up @@ -156,8 +155,8 @@ func (r *DRClusterReconciler) drClusterSecretMapFunc(secret client.Object) []rec
}

requests := make([]reconcile.Request, len(drcusters.Items))
for i, drcluster := range drcusters.Items {
requests[i].Name = drcluster.GetName()
for i := range drcusters.Items {
requests[i].Name = drcusters.Items[i].GetName()
}

return requests
Expand Down

0 comments on commit 4d99c40

Please sign in to comment.