Skip to content

Commit b9efbf4

Browse files
gnolongapecloud-bot
authored andcommitted
chore: support fixed requeue rate for pod not-found error (#9961)
(cherry picked from commit 201d60b)
1 parent 06362d9 commit b9efbf4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

controllers/dataprotection/restore_controller.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,10 @@ func (r *RestoreReconciler) handleRunningPhase(reqCtx intctrlutil.RequestCtx, re
294294
r.Recorder.Event(restore, corev1.EventTypeWarning, dprestore.ReasonRestoreFailed, err.Error())
295295
err = nil
296296
}
297+
if intctrlutil.IsTargetError(err, intctrlutil.ErrorTypeRequeue) {
298+
r.Recorder.Event(restore, corev1.EventTypeWarning, corev1.EventTypeWarning, err.Error())
299+
return intctrlutil.RequeueAfter(reconcileInterval, reqCtx.Log, "")
300+
}
297301
// patch restore status if changes occur
298302
if !reflect.DeepEqual(restoreMgr.OriginalRestore.Status, restoreMgr.Restore.Status) {
299303
err = r.Client.Status().Patch(reqCtx.Ctx, restoreMgr.Restore, client.MergeFrom(restoreMgr.OriginalRestore))

pkg/dataprotection/restore/manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,7 @@ func (r *RestoreManager) BuildPostReadyActionJobs(reqCtx intctrlutil.RequestCtx,
580580
return nil, err
581581
}
582582
if len(targetPodList.Items) == 0 {
583-
return nil, fmt.Errorf("can not found any pod by spec.readyConfig.%s.target.podSelector", msgKey)
583+
return nil, intctrlutil.NewErrorf(intctrlutil.ErrorTypeRequeue, "can not found any pod by spec.readyConfig.%s.target.podSelector", msgKey)
584584
}
585585
return targetPodList, nil
586586
}

0 commit comments

Comments
 (0)