diff --git a/pkg/controller/backup_controller.go b/pkg/controller/backup_controller.go index 9fcb14e99..7228719ea 100644 --- a/pkg/controller/backup_controller.go +++ b/pkg/controller/backup_controller.go @@ -252,8 +252,6 @@ func (b *backupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr if err := kubeutil.PatchResource(original, request.Backup, b.kbClient); err != nil { return ctrl.Result{}, errors.Wrapf(err, "error updating Backup status to %s", request.Status.Phase) } - // store ref to just-updated item for creating patch - original = request.Backup.DeepCopy() backupScheduleName := request.GetLabels()[velerov1api.ScheduleNameLabel] @@ -265,6 +263,9 @@ func (b *backupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr return ctrl.Result{}, nil } + // store ref to just-updated item for creating patch + original = request.Backup.DeepCopy() + b.backupTracker.Add(request.Namespace, request.Name) defer func() { switch request.Status.Phase {