Skip to content

Commit 08a741f

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

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ import (
5858
const (
5959
MaxBackOffDurationForReconciler = 5 * time.Minute
6060
workerThreadsEnvVar = "WORKER_THREADS_VIRTUAL_MACHINE_SNAPSHOT"
61-
defaultMaxWorkerThreads = 10
61+
defaultMaxWorkerThreads = 20
6262
allowedRetriesToPatchCNSVolumeInfo = 5
6363
SyncVolumeFinalizer = "cns.vmware.com/syncvolume"
6464
VMSnapshotFinalizer = "vmoperator.vmware.com/virtualmachinesnapshot"
@@ -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)