Skip to content

Commit

Permalink
fix issue 6490
Browse files Browse the repository at this point in the history
Signed-off-by: Lyndon-Li <lyonghui@vmware.com>
  • Loading branch information
Lyndon-Li committed Jul 13, 2023
1 parent 17d782f commit 79b1d71
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelogs/unreleased/6491-Lyndon-Li
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix issue 6490, If a backup has multiple async operations and one operation fails while others are still in-progress, when all the operations finish, the backup will be set as Completed falsely
7 changes: 4 additions & 3 deletions pkg/controller/backup_operations_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,15 @@ func (c *backupOperationsReconciler) Reconcile(ctx context.Context, req ctrl.Req
operations.ChangesSinceUpdate = true
}

if len(operations.ErrsSinceUpdate) > 0 {
backup.Status.Phase = velerov1api.BackupPhaseWaitingForPluginOperationsPartiallyFailed
}

// if stillInProgress is false, backup moves to finalize phase and needs update
// if operations.ErrsSinceUpdate is not empty, then backup phase needs to change to
// BackupPhaseWaitingForPluginOperationsPartiallyFailed and needs update
// If the only changes are incremental progress, then no write is necessary, progress can remain in memory
if !stillInProgress {
if len(operations.ErrsSinceUpdate) > 0 {
backup.Status.Phase = velerov1api.BackupPhaseWaitingForPluginOperationsPartiallyFailed
}
if backup.Status.Phase == velerov1api.BackupPhaseWaitingForPluginOperations {
log.Infof("Marking backup %s Finalizing", backup.Name)
backup.Status.Phase = velerov1api.BackupPhaseFinalizing
Expand Down

0 comments on commit 79b1d71

Please sign in to comment.