@@ -98,10 +98,10 @@ func (eh *ErrorHandler) HandleError(ctx context.Context, err error, resource coh
9898 return eh .attemptRecovery (ctx , err , resource )
9999 case ErrorCategoryPermanent :
100100 // For permanent errors, don't requeue
101- return reconcile.Result {Requeue : false }, nil
101+ return reconcile.Result {}, nil
102102 default :
103103 // For unknown errors, requeue with a short delay
104- return reconcile.Result {Requeue : true , RequeueAfter : 5 * time .Second }, nil
104+ return reconcile.Result {RequeueAfter : 5 * time .Second }, nil
105105 }
106106}
107107
@@ -360,7 +360,7 @@ func (eh *ErrorHandler) handleTransientError(resource coh.CoherenceResource) (re
360360 "errorCount" , count ,
361361 "backoff" , backoff )
362362
363- return reconcile.Result {Requeue : true , RequeueAfter : backoff }, nil
363+ return reconcile.Result {RequeueAfter : backoff }, nil
364364}
365365
366366// attemptRecovery attempts to recover from a recoverable error
@@ -371,7 +371,7 @@ func (eh *ErrorHandler) attemptRecovery(ctx context.Context, err error, resource
371371 Namespace : resource .GetNamespace (),
372372 Name : resource .GetName (),
373373 }, latest ); err != nil {
374- return reconcile.Result {Requeue : true }, err
374+ return reconcile.Result {RequeueAfter : time . Minute }, err
375375 }
376376
377377 // Get the annotations
@@ -391,7 +391,7 @@ func (eh *ErrorHandler) attemptRecovery(ctx context.Context, err error, resource
391391 "resource" , resource .GetName (),
392392 "namespace" , resource .GetNamespace (),
393393 "lastAttempt" , lastAttempt )
394- return reconcile.Result {Requeue : true , RequeueAfter : 1 * time .Minute }, nil
394+ return reconcile.Result {RequeueAfter : 1 * time .Minute }, nil
395395 }
396396 }
397397 }
@@ -402,7 +402,7 @@ func (eh *ErrorHandler) attemptRecovery(ctx context.Context, err error, resource
402402
403403 // Update the resource
404404 if err := eh .Client .Update (ctx , latest ); err != nil {
405- return reconcile.Result {Requeue : true }, err
405+ return reconcile.Result {RequeueAfter : time . Minute }, err
406406 }
407407
408408 // Log the recovery attempt with detailed diagnostics
@@ -463,7 +463,7 @@ func (eh *ErrorHandler) attemptRecovery(ctx context.Context, err error, resource
463463 eh .Log .Error (updateErr , "Failed to update resource with diagnostic information" )
464464 }
465465
466- return reconcile.Result {Requeue : true , RequeueAfter : 30 * time .Second }, nil
466+ return reconcile.Result {RequeueAfter : 30 * time .Second }, nil
467467}
468468
469469// recoverFromServiceSuspensionFailure attempts to recover from a service suspension failure
@@ -485,7 +485,7 @@ func (eh *ErrorHandler) recoverFromServiceSuspensionFailure(ctx context.Context,
485485 Namespace : resource .GetNamespace (),
486486 Name : resource .GetName (),
487487 }, latest ); err != nil {
488- return reconcile.Result {Requeue : true }, err
488+ return reconcile.Result {RequeueAfter : time . Minute }, err
489489 }
490490
491491 // Check if this is a deletion and has the Coherence finalizer
@@ -503,7 +503,7 @@ func (eh *ErrorHandler) recoverFromServiceSuspensionFailure(ctx context.Context,
503503 // Update the resource with the annotation
504504 if err := eh .Client .Update (ctx , latest ); err != nil {
505505 eh .Log .Error (err , "Failed to add finalizer bypass annotation" )
506- return reconcile.Result {Requeue : true }, err
506+ return reconcile.Result {RequeueAfter : time . Minute }, err
507507 }
508508
509509 eh .Log .Info ("Added finalizer bypass annotation to resource" ,
@@ -515,7 +515,7 @@ func (eh *ErrorHandler) recoverFromServiceSuspensionFailure(ctx context.Context,
515515 }
516516
517517 // 4. Return a result that requeues after a short delay to check if recovery was successful
518- return reconcile.Result {Requeue : true , RequeueAfter : 10 * time .Second }, nil
518+ return reconcile.Result {RequeueAfter : 10 * time .Second }, nil
519519}
520520
521521// recoverFromPDBIssue attempts to recover from Pod Disruption Budget issues
@@ -536,7 +536,7 @@ func (eh *ErrorHandler) recoverFromPDBIssue(ctx context.Context, resource coh.Co
536536 Namespace : resource .GetNamespace (),
537537 Name : resource .GetName (),
538538 }, latest ); err != nil {
539- return reconcile.Result {Requeue : true }, err
539+ return reconcile.Result {RequeueAfter : time . Minute }, err
540540 }
541541
542542 // Add diagnostic information
@@ -552,7 +552,7 @@ func (eh *ErrorHandler) recoverFromPDBIssue(ctx context.Context, resource coh.Co
552552 // Update the resource with the annotation
553553 if err := eh .Client .Update (ctx , latest ); err != nil {
554554 eh .Log .Error (err , "Failed to add PDB issue annotation" )
555- return reconcile.Result {Requeue : true }, err
555+ return reconcile.Result {RequeueAfter : time . Minute }, err
556556 }
557557
558558 eh .Log .Info ("Added PDB issue annotation to resource" ,
@@ -563,7 +563,7 @@ func (eh *ErrorHandler) recoverFromPDBIssue(ctx context.Context, resource coh.Co
563563 "Added PDB issue annotation to resource" )
564564
565565 // Return a result that requeues after a delay
566- return reconcile.Result {Requeue : true , RequeueAfter : 30 * time .Second }, nil
566+ return reconcile.Result {RequeueAfter : 30 * time .Second }, nil
567567}
568568
569569// recoverFromStatefulSetPatchIssue attempts to recover from StatefulSet patching issues
@@ -583,7 +583,7 @@ func (eh *ErrorHandler) recoverFromStatefulSetPatchIssue(ctx context.Context, re
583583 Namespace : resource .GetNamespace (),
584584 Name : resource .GetName (),
585585 }, latest ); err != nil {
586- return reconcile.Result {Requeue : true }, err
586+ return reconcile.Result {RequeueAfter : time . Minute }, err
587587 }
588588
589589 // Add diagnostic information
@@ -598,7 +598,7 @@ func (eh *ErrorHandler) recoverFromStatefulSetPatchIssue(ctx context.Context, re
598598 // Update the resource with the annotation
599599 if err := eh .Client .Update (ctx , latest ); err != nil {
600600 eh .Log .Error (err , "Failed to add force-reconcile annotation" )
601- return reconcile.Result {Requeue : true }, err
601+ return reconcile.Result {RequeueAfter : time . Minute }, err
602602 }
603603
604604 eh .Log .Info ("Added force-reconcile annotation to resource" ,
@@ -609,7 +609,7 @@ func (eh *ErrorHandler) recoverFromStatefulSetPatchIssue(ctx context.Context, re
609609 "Added force-reconcile annotation to resource to address StatefulSet patching issue" )
610610
611611 // Return a result that requeues after a delay
612- return reconcile.Result {Requeue : true , RequeueAfter : 10 * time .Second }, nil
612+ return reconcile.Result {RequeueAfter : 10 * time .Second }, nil
613613}
614614
615615// recoverFromQuotaIssue attempts to recover from resource quota issues
@@ -629,7 +629,7 @@ func (eh *ErrorHandler) recoverFromQuotaIssue(ctx context.Context, resource coh.
629629 Namespace : resource .GetNamespace (),
630630 Name : resource .GetName (),
631631 }, latest ); err != nil {
632- return reconcile.Result {Requeue : true }, err
632+ return reconcile.Result {RequeueAfter : time . Minute }, err
633633 }
634634
635635 // Add diagnostic information
@@ -645,7 +645,7 @@ func (eh *ErrorHandler) recoverFromQuotaIssue(ctx context.Context, resource coh.
645645 // Update the resource with the annotation
646646 if err := eh .Client .Update (ctx , latest ); err != nil {
647647 eh .Log .Error (err , "Failed to add quota issue annotation" )
648- return reconcile.Result {Requeue : true }, err
648+ return reconcile.Result {RequeueAfter : time . Minute }, err
649649 }
650650
651651 eh .Log .Info ("Added quota issue annotation to resource" ,
@@ -656,7 +656,7 @@ func (eh *ErrorHandler) recoverFromQuotaIssue(ctx context.Context, resource coh.
656656 "Resource quota exceeded - manual intervention may be required to increase quota or reduce resource requests" )
657657
658658 // Return a result that requeues after a longer delay
659- return reconcile.Result {Requeue : true , RequeueAfter : 2 * time .Minute }, nil
659+ return reconcile.Result {RequeueAfter : 2 * time .Minute }, nil
660660}
661661
662662// recoverFromSchedulingIssue attempts to recover from pod scheduling issues
@@ -676,7 +676,7 @@ func (eh *ErrorHandler) recoverFromSchedulingIssue(ctx context.Context, resource
676676 Namespace : resource .GetNamespace (),
677677 Name : resource .GetName (),
678678 }, latest ); err != nil {
679- return reconcile.Result {Requeue : true }, err
679+ return reconcile.Result {RequeueAfter : time . Minute }, err
680680 }
681681
682682 // Add diagnostic information
@@ -692,7 +692,7 @@ func (eh *ErrorHandler) recoverFromSchedulingIssue(ctx context.Context, resource
692692 // Update the resource with the annotation
693693 if err := eh .Client .Update (ctx , latest ); err != nil {
694694 eh .Log .Error (err , "Failed to add scheduling issue annotation" )
695- return reconcile.Result {Requeue : true }, err
695+ return reconcile.Result {RequeueAfter : time . Minute }, err
696696 }
697697
698698 eh .Log .Info ("Added scheduling issue annotation to resource" ,
@@ -703,7 +703,7 @@ func (eh *ErrorHandler) recoverFromSchedulingIssue(ctx context.Context, resource
703703 "Pod scheduling issue detected - manual intervention may be required to address node resources or affinity rules" )
704704
705705 // Return a result that requeues after a longer delay
706- return reconcile.Result {Requeue : true , RequeueAfter : 2 * time .Minute }, nil
706+ return reconcile.Result {RequeueAfter : 2 * time .Minute }, nil
707707}
708708
709709// RetryOnError retries the given function with exponential backoff on error
0 commit comments