diff --git a/controllers/cloudstackmachine_controller.go b/controllers/cloudstackmachine_controller.go index ef37f729..c081e7de 100644 --- a/controllers/cloudstackmachine_controller.go +++ b/controllers/cloudstackmachine_controller.go @@ -19,6 +19,7 @@ package controllers import ( "context" "fmt" + "k8s.io/klog/v2" "math/rand" "reflect" "regexp" @@ -460,15 +461,18 @@ func (reconciler *CloudStackMachineReconciler) SetupWithManager(ctx context.Cont log.V(4).Info("Expected CloudStackIsolatedNetwork", "type", fmt.Sprintf("%T", e.ObjectOld)) return false } + log = log.WithValues("CloudStackIsolatedNetwork", klog.KObj(oldCSIsoNet)) newCSIsoNet := e.ObjectNew.(*infrav1.CloudStackIsolatedNetwork) // We're only interested in status updates, not Spec updates + log.V(4).Info("CSIsonet generation", "old", oldCSIsoNet.Generation, "new", newCSIsoNet.Generation) if oldCSIsoNet.Generation != newCSIsoNet.Generation { return false } // Only trigger a CloudStackMachine reconcile if the loadbalancer rules changed. + log.V(4).Info("LoadBalancerRuleIDs length", "old", len(oldCSIsoNet.Status.LoadBalancerRuleIDs), "new", len(newCSIsoNet.Status.LoadBalancerRuleIDs)) return len(oldCSIsoNet.Status.LoadBalancerRuleIDs) != len(newCSIsoNet.Status.LoadBalancerRuleIDs) }, },