@@ -219,7 +219,7 @@ func (r *AppWrapperReconciler) Reconcile(ctx context.Context, req ctrl.Request)
219
219
if fatal {
220
220
return r .updateStatus (ctx , aw , workloadv1beta2 .AppWrapperFailed ) // always move to failed on fatal error
221
221
} else {
222
- return r .resetOrFail (ctx , aw , false )
222
+ return r .resetOrFail (ctx , aw , false , 1 )
223
223
}
224
224
}
225
225
return r .updateStatus (ctx , aw , workloadv1beta2 .AppWrapperRunning )
@@ -259,7 +259,7 @@ func (r *AppWrapperReconciler) Reconcile(ctx context.Context, req ctrl.Request)
259
259
Reason : "FailedComponent" ,
260
260
Message : fmt .Sprintf ("Found %v failed components" , compStatus .failed ),
261
261
})
262
- return r .resetOrFail (ctx , aw , podStatus .terminalFailure )
262
+ return r .resetOrFail (ctx , aw , podStatus .terminalFailure , 1 )
263
263
}
264
264
265
265
// Handle Success
@@ -297,7 +297,7 @@ func (r *AppWrapperReconciler) Reconcile(ctx context.Context, req ctrl.Request)
297
297
if now .Before (deadline ) {
298
298
return ctrl.Result {RequeueAfter : deadline .Sub (now )}, r .Status ().Update (ctx , aw )
299
299
} else {
300
- return r .resetOrFail (ctx , aw , podStatus .terminalFailure )
300
+ return r .resetOrFail (ctx , aw , podStatus .terminalFailure , 1 )
301
301
}
302
302
}
303
303
@@ -309,8 +309,8 @@ func (r *AppWrapperReconciler) Reconcile(ctx context.Context, req ctrl.Request)
309
309
Reason : "AutopilotUnhealthy" ,
310
310
Message : fmt .Sprintf ("Workload contains pods using unhealthy resources on Nodes: %v" , podStatus .unhealthyNodes ),
311
311
})
312
- // Go to reset directly because an Autopilot triggered evacuation does not count against the retry limit
313
- return r .updateStatus (ctx , aw , workloadv1beta2 . AppWrapperResetting )
312
+ // Autopilot triggered evacuation does not increment retry count
313
+ return r .resetOrFail (ctx , aw , false , 0 )
314
314
}
315
315
316
316
clearCondition (aw , workloadv1beta2 .Unhealthy , "FoundNoFailedPods" , "" )
@@ -344,7 +344,7 @@ func (r *AppWrapperReconciler) Reconcile(ctx context.Context, req ctrl.Request)
344
344
Reason : "InsufficientPodsReady" ,
345
345
Message : podDetailsMessage ,
346
346
})
347
- return r .resetOrFail (ctx , aw , podStatus .terminalFailure )
347
+ return r .resetOrFail (ctx , aw , podStatus .terminalFailure , 1 )
348
348
}
349
349
350
350
case workloadv1beta2 .AppWrapperSuspending : // undeploying components
@@ -487,10 +487,10 @@ func (r *AppWrapperReconciler) updateStatus(ctx context.Context, aw *workloadv1b
487
487
return ctrl.Result {}, nil
488
488
}
489
489
490
- func (r * AppWrapperReconciler ) resetOrFail (ctx context.Context , aw * workloadv1beta2.AppWrapper , terminalFailure bool ) (ctrl.Result , error ) {
490
+ func (r * AppWrapperReconciler ) resetOrFail (ctx context.Context , aw * workloadv1beta2.AppWrapper , terminalFailure bool , retryIncrement int32 ) (ctrl.Result , error ) {
491
491
maxRetries := r .retryLimit (ctx , aw )
492
492
if ! terminalFailure && aw .Status .Retries < maxRetries {
493
- aw .Status .Retries += 1
493
+ aw .Status .Retries += retryIncrement
494
494
return r .updateStatus (ctx , aw , workloadv1beta2 .AppWrapperResetting )
495
495
} else {
496
496
return r .updateStatus (ctx , aw , workloadv1beta2 .AppWrapperFailed )
0 commit comments