Add the finalization phase to the restore workflow

Signed-off-by: allenxu404 <qix2@vmware.com>
This commit is contained in:
allenxu404
2024-01-19 14:49:07 +08:00
parent e727d29bcd
commit 2b8bb871d3
14 changed files with 544 additions and 27 deletions

View File

@@ -694,6 +694,7 @@ func (s *server) runControllers(defaultVolumeSnapshotLocations map[string]string
controller.RestoreOperations: {},
controller.Schedule: {},
controller.ServerStatusRequest: {},
controller.RestoreFinalizer: {},
}
if s.config.restoreOnly {
@@ -983,6 +984,19 @@ func (s *server) runControllers(defaultVolumeSnapshotLocations map[string]string
}
}
if _, ok := enabledRuntimeControllers[controller.RestoreFinalizer]; ok {
if err := controller.NewRestoreFinalizerReconciler(
s.logger,
s.namespace,
s.mgr.GetClient(),
newPluginManager,
backupStoreGetter,
s.metrics,
).SetupWithManager(s.mgr); err != nil {
s.logger.Fatal(err, "unable to create controller", "controller", controller.RestoreFinalizer)
}
}
s.logger.Info("Server starting...")
if err := s.mgr.Start(s.ctx); err != nil {