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

@@ -645,18 +645,16 @@ func (r *restoreReconciler) runValidatedRestore(restore *api.Restore, info backu
r.logger.Debug("Restore WaitingForPluginOperationsPartiallyFailed")
restore.Status.Phase = api.RestorePhaseWaitingForPluginOperationsPartiallyFailed
} else {
r.logger.Debug("Restore partially failed")
restore.Status.Phase = api.RestorePhasePartiallyFailed
r.metrics.RegisterRestorePartialFailure(restore.Spec.ScheduleName)
r.logger.Debug("Restore FinalizingPartiallyFailed")
restore.Status.Phase = api.RestorePhaseFinalizingPartiallyFailed
}
} else {
if inProgressOperations {
r.logger.Debug("Restore WaitingForPluginOperations")
restore.Status.Phase = api.RestorePhaseWaitingForPluginOperations
} else {
r.logger.Debug("Restore completed")
restore.Status.Phase = api.RestorePhaseCompleted
r.metrics.RegisterRestoreSuccess(restore.Spec.ScheduleName)
r.logger.Debug("Restore Finalizing")
restore.Status.Phase = api.RestorePhaseFinalizing
}
}
return nil