Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete the expired deletebackuprequests that are stuck in "InProgress" #6476

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelogs/unreleased/6476-reasonerjt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Delete the expired deletebackuprequests that are stuck in "InProgress"
7 changes: 4 additions & 3 deletions pkg/controller/backup_deletion_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,16 @@ func (r *backupDeletionReconciler) Reconcile(ctx context.Context, req ctrl.Reque

// Since we use the reconciler along with the PeriodicalEnqueueSource, there may be reconciliation triggered by
// stale requests.
if dbr.Status.Phase == velerov1api.DeleteBackupRequestPhaseProcessed {
if dbr.Status.Phase == velerov1api.DeleteBackupRequestPhaseProcessed ||
dbr.Status.Phase == velerov1api.DeleteBackupRequestPhaseInProgress {
age := r.clock.Now().Sub(dbr.CreationTimestamp.Time)
if age >= deleteBackupRequestMaxAge { // delete the expired request
log.Debug("The request is expired, deleting it.")
log.Debugf("The request is expired, status: %s, deleting it.", dbr.Status.Phase)
if err := r.Delete(ctx, dbr); err != nil {
log.WithError(err).Error("Error deleting DeleteBackupRequest")
}
} else {
log.Info("The request has been processed, skip.")
log.Infof("The request has status '%s', skip.", dbr.Status.Phase)
}
return ctrl.Result{}, nil
}
Expand Down
Loading