From f9569f5292944d8f23423bc15a08422656609e4f Mon Sep 17 00:00:00 2001 From: Nikhil Barge Date: Wed, 8 Oct 2025 08:47:53 +0530 Subject: [PATCH] Fix virtualmachinesnapshot controller to watch vmsnapshot resource --- .../virtualmachinesnapshot_controller.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/syncer/cnsoperator/controller/virtualmachinesnapshot/virtualmachinesnapshot_controller.go b/pkg/syncer/cnsoperator/controller/virtualmachinesnapshot/virtualmachinesnapshot_controller.go index 57845fba4c..930780810b 100644 --- a/pkg/syncer/cnsoperator/controller/virtualmachinesnapshot/virtualmachinesnapshot_controller.go +++ b/pkg/syncer/cnsoperator/controller/virtualmachinesnapshot/virtualmachinesnapshot_controller.go @@ -161,7 +161,9 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error { maxWorkerThreads := util.GetMaxWorkerThreads(ctx, workerThreadsEnvVar, defaultMaxWorkerThreads) // Create a new controller. - err := ctrl.NewControllerManagedBy(mgr).Named("virtualmachinesnapshot-controller"). + err := ctrl.NewControllerManagedBy(mgr). + For(&vmoperatortypes.VirtualMachineSnapshot{}). + Named("virtualmachinesnapshot-controller"). WithEventFilter(predicate.GenerationChangedPredicate{}). WithOptions(controller.Options{MaxConcurrentReconciles: maxWorkerThreads}). Complete(r) @@ -169,7 +171,6 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error { log.Errorf("Failed to build application controller. Err: %v", err) return err } - backOffDuration = make(map[apitypes.NamespacedName]time.Duration) return nil }