@@ -322,7 +322,7 @@ func (r *AppWrapperReconciler) Reconcile(ctx context.Context, req ctrl.Request)
322
322
323
323
// Pause before transitioning to Resuming to heuristically allow transient system problems to subside
324
324
whenReset := meta .FindStatusCondition (aw .Status .Conditions , string (workloadv1beta2 .Unhealthy )).LastTransitionTime
325
- pauseDuration := r .resettingPauseDuration (ctx , aw )
325
+ pauseDuration := r .retryPauseDuration (ctx , aw )
326
326
now := time .Now ()
327
327
deadline := whenReset .Add (pauseDuration )
328
328
if now .Before (deadline ) {
@@ -342,14 +342,14 @@ func (r *AppWrapperReconciler) Reconcile(ctx context.Context, req ctrl.Request)
342
342
// When an appwrapper is annotated with a non-zero debugging delay,
343
343
// we hold quota for the delay period and do not delete the resources of
344
344
// a failed appwrapper unless Kueue preempts it by setting Suspend to true.
345
- deletionDelay := r .debuggingFailureDeletionDelay (ctx , aw )
345
+ deletionDelay := r .deletionOnFailureGraceDuration (ctx , aw )
346
346
347
347
if deletionDelay > 0 && ! aw .Spec .Suspend {
348
348
meta .SetStatusCondition (& aw .Status .Conditions , metav1.Condition {
349
349
Type : string (workloadv1beta2 .DeletingResources ),
350
350
Status : metav1 .ConditionFalse ,
351
351
Reason : "DeletionPaused" ,
352
- Message : fmt .Sprintf ("%v has value %v" , workloadv1beta2 .DebuggingFailureDeletionDelayDurationAnnotation , deletionDelay ),
352
+ Message : fmt .Sprintf ("%v has value %v" , workloadv1beta2 .DeletionOnFailureGracePeriodAnnotation , deletionDelay ),
353
353
})
354
354
whenDelayed := meta .FindStatusCondition (aw .Status .Conditions , string (workloadv1beta2 .DeletingResources )).LastTransitionTime
355
355
@@ -457,8 +457,8 @@ func (r *AppWrapperReconciler) workloadStatus(ctx context.Context, aw *workloadv
457
457
func (r * AppWrapperReconciler ) limitDuration (desired time.Duration ) time.Duration {
458
458
if desired < 0 {
459
459
return 0 * time .Second
460
- } else if desired > r .Config .FaultTolerance .GracePeriodCeiling {
461
- return r .Config .FaultTolerance .GracePeriodCeiling
460
+ } else if desired > r .Config .FaultTolerance .GracePeriodMaximum {
461
+ return r .Config .FaultTolerance .GracePeriodMaximum
462
462
} else {
463
463
return desired
464
464
}
@@ -469,7 +469,7 @@ func (r *AppWrapperReconciler) admissionGraceDuration(ctx context.Context, aw *w
469
469
if duration , err := time .ParseDuration (userPeriod ); err == nil {
470
470
return r .limitDuration (duration )
471
471
} else {
472
- log .FromContext (ctx ).Info ("Malformed warmup period annotation" , "annotation" , userPeriod , "error" , err )
472
+ log .FromContext (ctx ).Info ("Malformed admission grace period annotation" , "annotation" , userPeriod , "error" , err )
473
473
}
474
474
}
475
475
return r .limitDuration (r .Config .FaultTolerance .AdmissionGracePeriod )
@@ -480,7 +480,7 @@ func (r *AppWrapperReconciler) warmupGraceDuration(ctx context.Context, aw *work
480
480
if duration , err := time .ParseDuration (userPeriod ); err == nil {
481
481
return r .limitDuration (duration )
482
482
} else {
483
- log .FromContext (ctx ).Info ("Malformed warmup period annotation" , "annotation" , userPeriod , "error" , err )
483
+ log .FromContext (ctx ).Info ("Malformed warmup grace period annotation" , "annotation" , userPeriod , "error" , err )
484
484
}
485
485
}
486
486
return r .limitDuration (r .Config .FaultTolerance .WarmupGracePeriod )
@@ -508,50 +508,50 @@ func (r *AppWrapperReconciler) retryLimit(ctx context.Context, aw *workloadv1bet
508
508
return r .Config .FaultTolerance .RetryLimit
509
509
}
510
510
511
- func (r * AppWrapperReconciler ) resettingPauseDuration (ctx context.Context , aw * workloadv1beta2.AppWrapper ) time.Duration {
512
- if userPeriod , ok := aw .Annotations [workloadv1beta2 .ResetPauseDurationAnnotation ]; ok {
511
+ func (r * AppWrapperReconciler ) retryPauseDuration (ctx context.Context , aw * workloadv1beta2.AppWrapper ) time.Duration {
512
+ if userPeriod , ok := aw .Annotations [workloadv1beta2 .RetryPausePeriodDurationAnnotation ]; ok {
513
513
if duration , err := time .ParseDuration (userPeriod ); err == nil {
514
514
return r .limitDuration (duration )
515
515
} else {
516
- log .FromContext (ctx ).Info ("Malformed reset pause annotation" , "annotation" , userPeriod , "error" , err )
516
+ log .FromContext (ctx ).Info ("Malformed retry pause annotation" , "annotation" , userPeriod , "error" , err )
517
517
}
518
518
}
519
- return r .limitDuration (r .Config .FaultTolerance .ResetPause )
519
+ return r .limitDuration (r .Config .FaultTolerance .RetryPausePeriod )
520
520
}
521
521
522
- func (r * AppWrapperReconciler ) deletionGraceDuration (ctx context.Context , aw * workloadv1beta2.AppWrapper ) time.Duration {
523
- if userPeriod , ok := aw .Annotations [workloadv1beta2 .DeletionGracePeriodAnnotation ]; ok {
522
+ func (r * AppWrapperReconciler ) forcefulDeletionGraceDuration (ctx context.Context , aw * workloadv1beta2.AppWrapper ) time.Duration {
523
+ if userPeriod , ok := aw .Annotations [workloadv1beta2 .ForcefulDeletionGracePeriodAnnotation ]; ok {
524
524
if duration , err := time .ParseDuration (userPeriod ); err == nil {
525
525
return r .limitDuration (duration )
526
526
} else {
527
- log .FromContext (ctx ).Info ("Malformed deletion period annotation" , "annotation" , userPeriod , "error" , err )
527
+ log .FromContext (ctx ).Info ("Malformed forceful deletion period annotation" , "annotation" , userPeriod , "error" , err )
528
528
}
529
529
}
530
- return r .limitDuration (r .Config .FaultTolerance .DeletionGracePeriod )
530
+ return r .limitDuration (r .Config .FaultTolerance .ForcefulDeletionGracePeriod )
531
531
}
532
532
533
- func (r * AppWrapperReconciler ) debuggingFailureDeletionDelay (ctx context.Context , aw * workloadv1beta2.AppWrapper ) time.Duration {
534
- if userPeriod , ok := aw .Annotations [workloadv1beta2 .DebuggingFailureDeletionDelayDurationAnnotation ]; ok {
533
+ func (r * AppWrapperReconciler ) deletionOnFailureGraceDuration (ctx context.Context , aw * workloadv1beta2.AppWrapper ) time.Duration {
534
+ if userPeriod , ok := aw .Annotations [workloadv1beta2 .DeletionOnFailureGracePeriodAnnotation ]; ok {
535
535
if duration , err := time .ParseDuration (userPeriod ); err == nil {
536
536
return r .limitDuration (duration )
537
537
} else {
538
- log .FromContext (ctx ).Info ("Malformed delay deletion annotation" , "annotation" , userPeriod , "error" , err )
538
+ log .FromContext (ctx ).Info ("Malformed delection on failue delay annotation" , "annotation" , userPeriod , "error" , err )
539
539
}
540
540
}
541
541
return 0 * time .Second
542
542
}
543
543
544
544
func (r * AppWrapperReconciler ) timeToLiveAfterSucceededDuration (ctx context.Context , aw * workloadv1beta2.AppWrapper ) time.Duration {
545
- if userPeriod , ok := aw .Annotations [workloadv1beta2 .SuccessTTLDurationAnnotation ]; ok {
545
+ if userPeriod , ok := aw .Annotations [workloadv1beta2 .SuccessTTLAnnotation ]; ok {
546
546
if duration , err := time .ParseDuration (userPeriod ); err == nil {
547
- if duration > 0 && duration < r .Config .FaultTolerance .SuccessTTLCeiling {
547
+ if duration > 0 && duration < r .Config .FaultTolerance .SuccessTTL {
548
548
return duration
549
549
}
550
550
} else {
551
551
log .FromContext (ctx ).Info ("Malformed successTTL annotation" , "annotation" , userPeriod , "error" , err )
552
552
}
553
553
}
554
- return r .Config .FaultTolerance .SuccessTTLCeiling
554
+ return r .Config .FaultTolerance .SuccessTTL
555
555
}
556
556
557
557
func clearCondition (aw * workloadv1beta2.AppWrapper , condition workloadv1beta2.AppWrapperCondition , reason string , message string ) {
0 commit comments