Skip to content

Commit f9569f5

Browse files
committed
Fix virtualmachinesnapshot controller to watch vmsnapshot resource
1 parent a68cb53 commit f9569f5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/syncer/cnsoperator/controller/virtualmachinesnapshot/virtualmachinesnapshot_controller.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,16 @@ func add(mgr manager.Manager, r reconcile.Reconciler) error {
161161
maxWorkerThreads := util.GetMaxWorkerThreads(ctx,
162162
workerThreadsEnvVar, defaultMaxWorkerThreads)
163163
// Create a new controller.
164-
err := ctrl.NewControllerManagedBy(mgr).Named("virtualmachinesnapshot-controller").
164+
err := ctrl.NewControllerManagedBy(mgr).
165+
For(&vmoperatortypes.VirtualMachineSnapshot{}).
166+
Named("virtualmachinesnapshot-controller").
165167
WithEventFilter(predicate.GenerationChangedPredicate{}).
166168
WithOptions(controller.Options{MaxConcurrentReconciles: maxWorkerThreads}).
167169
Complete(r)
168170
if err != nil {
169171
log.Errorf("Failed to build application controller. Err: %v", err)
170172
return err
171173
}
172-
173174
backOffDuration = make(map[apitypes.NamespacedName]time.Duration)
174175
return nil
175176
}

0 commit comments

Comments
 (0)