@@ -262,30 +262,30 @@ func waitForResourcesToCleanUp(allBindings []placementv1beta1.BindingObj, placem
262262 if _ , exist := bindingMap [bindingSpec .TargetCluster ]; ! exist {
263263 bindingMap [bindingSpec .TargetCluster ] = binding
264264 } else {
265- return false , controller .NewUnexpectedBehaviorError (fmt .Errorf ("the same cluster `%s` has bindings `%s` and `%s` pointing to it" ,
266- bindingSpec .TargetCluster , klog .KObj (bindingMap [bindingSpec .TargetCluster ]), bindingKRef ))
265+ return false , controller .NewUnexpectedBehaviorError (fmt .Errorf ("the same cluster `%s` has bindings `%s/%s` and `%s/%s` pointing to it" ,
266+ bindingSpec .TargetCluster , bindingMap [bindingSpec .TargetCluster ].GetNamespace (), bindingMap [bindingSpec .TargetCluster ].GetName (),
267+ binding .GetNamespace (), binding .GetName ()))
267268 }
268269 }
269270 }
270271 // check if there are any cluster that has a binding that is both being deleted and scheduled
271272 for cluster , binding := range bindingMap {
272273 // check if there is a deleting binding on the same cluster
273- bindingKRef := klog .KObj (binding )
274274 if deletingBinding [cluster ] {
275- klog .V (2 ).InfoS ("Find a binding assigned to a cluster with another deleting binding" , "placement" , placementObjRef , "binding" , bindingKRef )
275+ klog .V (2 ).InfoS ("Find a binding assigned to a cluster with another deleting binding" , "placement" , placementObjRef , "binding" , klog . KObj ( binding ) )
276276 bindingSpec := binding .GetBindingSpec ()
277277 if bindingSpec .State == placementv1beta1 .BindingStateBound {
278278 // the rollout controller won't move a binding from scheduled state to bound if there is a deleting binding on the same cluster.
279279 return false , controller .NewUnexpectedBehaviorError (fmt .Errorf (
280- "find a cluster `%s` that has a bound binding `%s` and a deleting binding point to it" , bindingSpec .TargetCluster , bindingKRef ))
280+ "find a cluster `%s` that has a bound binding `%s/%s ` and a deleting binding point to it" , bindingSpec .TargetCluster , binding . GetNamespace (), binding . GetName () ))
281281 }
282282 if bindingSpec .State == placementv1beta1 .BindingStateUnscheduled {
283283 // this is a very rare case that the resource was in the middle of being removed from a member cluster after it is unselected.
284284 // then the cluster get selected and unselected in two scheduling before the member agent is able to clean up all the resources.
285285 if binding .GetAnnotations ()[placementv1beta1 .PreviousBindingStateAnnotation ] == string (placementv1beta1 .BindingStateBound ) {
286286 // its previous state can not be bound as rollout won't roll a binding with a deleting binding pointing to the same cluster.
287287 return false , controller .NewUnexpectedBehaviorError (fmt .Errorf (
288- "find a cluster `%s` that has a unscheduled binding `%s` with previous state is `bound` and a deleting binding point to it" , bindingSpec .TargetCluster , bindingKRef ))
288+ "find a cluster `%s` that has a unscheduled binding `%s/%s ` with previous state is `bound` and a deleting binding point to it" , bindingSpec .TargetCluster , binding . GetNamespace (), binding . GetName () ))
289289 }
290290 return true , nil
291291 }
@@ -764,11 +764,11 @@ func resourceSnapshotObjHandlerFuncs() handler.Funcs {
764764func resourceOverrideSnapshotHandlerFuncs (enqueueCRP bool ) handler.Funcs {
765765 return handler.Funcs {
766766 CreateFunc : func (ctx context.Context , e event.CreateEvent , q workqueue.TypedRateLimitingInterface [reconcile.Request ]) {
767- klog .V (2 ).InfoS ("Handling a resourceOverrideSnapshot create event" , "resourceOverrideSnapshot" , klog .KObj (e .Object ))
767+ klog .V (2 ).InfoS ("Handling a resourceOverrideSnapshot create event" , "resourceOverrideSnapshot" , klog .KObj (e .Object ), "enqueueCRP" , enqueueCRP )
768768 handleResourceOverrideSnapshot (e .Object , q , enqueueCRP )
769769 },
770770 GenericFunc : func (ctx context.Context , e event.GenericEvent , q workqueue.TypedRateLimitingInterface [reconcile.Request ]) {
771- klog .V (2 ).InfoS ("Handling a resourceOverrideSnapshot generic event" , "resourceOverrideSnapshot" , klog .KObj (e .Object ))
771+ klog .V (2 ).InfoS ("Handling a resourceOverrideSnapshot generic event" , "resourceOverrideSnapshot" , klog .KObj (e .Object ), "enqueueCRP" , enqueueCRP )
772772 handleResourceOverrideSnapshot (e .Object , q , enqueueCRP )
773773 },
774774 }
@@ -778,7 +778,7 @@ func resourceOverrideSnapshotHandlerFuncs(enqueueCRP bool) handler.Funcs {
778778func resourceOverrideHandlerFuncs (enqueueCRP bool ) handler.Funcs {
779779 return handler.Funcs {
780780 DeleteFunc : func (ctx context.Context , e event.DeleteEvent , q workqueue.TypedRateLimitingInterface [reconcile.Request ]) {
781- klog .V (2 ).InfoS ("Handling a resourceOverride delete event" , "resourceOverride" , klog .KObj (e .Object ))
781+ klog .V (2 ).InfoS ("Handling a resourceOverride delete event" , "resourceOverride" , klog .KObj (e .Object ), "enqueueCRP" , enqueueCRP )
782782 handleResourceOverride (e .Object , q , enqueueCRP )
783783 },
784784 }
@@ -880,18 +880,18 @@ func handleResourceOverrideSnapshot(o client.Object, q workqueue.TypedRateLimiti
880880 namespace := ""
881881 if enqueueCRP {
882882 if placementInOverride .Scope == placementv1beta1 .NamespaceScoped {
883- klog .V (2 ).InfoS ("Skipping a resourceOverrideSnapshot event with resource placement" , "resourceOverrideSnapshot" , snapshotKRef )
883+ klog .V (2 ).InfoS ("Skipping a resourceOverrideSnapshot event with resource placement" , "resourceOverrideSnapshot" , snapshotKRef , "enqueueCRP" , enqueueCRP )
884884 return
885885 }
886886 } else {
887887 if placementInOverride .Scope != placementv1beta1 .NamespaceScoped {
888- klog .V (2 ).InfoS ("Skipping a resourceOverrideSnapshot event with cluster resource placement" , "resourceOverrideSnapshot" , snapshotKRef )
888+ klog .V (2 ).InfoS ("Skipping a resourceOverrideSnapshot event with cluster resource placement" , "resourceOverrideSnapshot" , snapshotKRef , "enqueueCRP" , enqueueCRP )
889889 return
890890 }
891891 namespace = snapshot .GetNamespace ()
892892 }
893893
894- klog .V (2 ).InfoS ("Handling a resourceOverrideSnapshot event" , "resourceOverrideSnapshot" , snapshotKRef )
894+ klog .V (2 ).InfoS ("Handling a resourceOverrideSnapshot event" , "resourceOverrideSnapshot" , snapshotKRef , "enqueueCRP" , enqueueCRP )
895895 q .Add (reconcile.Request {
896896 NamespacedName : types.NamespacedName {Name : placementInOverride .Name , Namespace : namespace },
897897 })
@@ -951,18 +951,18 @@ func handleResourceOverride(o client.Object, q workqueue.TypedRateLimitingInterf
951951 namespace := ""
952952 if enqueueCRP {
953953 if ro .Spec .Placement .Scope == placementv1beta1 .NamespaceScoped {
954- klog .V (2 ).InfoS ("Skipping a resourceOverride event with resource placement" , "resourceOverride" , klog .KObj (ro ))
954+ klog .V (2 ).InfoS ("Skipping a resourceOverride event with resource placement" , "resourceOverride" , klog .KObj (ro ), "enqueueCRP" , enqueueCRP )
955955 return
956956 }
957957 } else {
958958 if ro .Spec .Placement .Scope != placementv1beta1 .NamespaceScoped {
959- klog .V (2 ).InfoS ("Skipping a resourceOverride event with cluster resource placement" , "resourceOverride" , klog .KObj (ro ))
959+ klog .V (2 ).InfoS ("Skipping a resourceOverride event with cluster resource placement" , "resourceOverride" , klog .KObj (ro ), "enqueueCRP" , enqueueCRP )
960960 return
961961 }
962962 namespace = ro .Namespace
963963 }
964964
965- klog .V (2 ).InfoS ("Handling a resourceOverride event" , "resourceOverride" , klog .KObj (ro ))
965+ klog .V (2 ).InfoS ("Handling a resourceOverride event" , "resourceOverride" , klog .KObj (ro ), "enqueueCRP" , enqueueCRP )
966966 q .Add (reconcile.Request {
967967 NamespacedName : types.NamespacedName {Name : ro .Spec .Placement .Name , Namespace : namespace },
968968 })
0 commit comments