@@ -57,24 +57,24 @@ func Reconcile(ctx context.Context, req ctrl.Request, instance runtimeobject.Run
5757 ctx = sentry .ContextWithSentryTags (ctx , sentryTags )
5858
5959 log .Info ().Msg ("start reconcile" )
60- generationChanged := true
6160 err := cl .Get (ctx , req .NamespacedName , instance )
6261 if err != nil {
6362 if kerrors .IsNotFound (err ) {
6463 log .Info ().Msg ("instance not found. It was likely deleted" )
6564 return ctrl.Result {}, nil
6665 }
67- return HandleClientError ("failed to retrieve instance" , log , err , generationChanged , sentryTags )
66+ return HandleClientError ("failed to retrieve instance" , log , err , true , sentryTags )
6867 }
6968
7069 originalCopy := instance .DeepCopyObject ()
7170 inDeletion := instance .GetDeletionTimestamp () != nil
71+ generationChanged := true
7272
7373 if l .Spreader () != nil && instance .GetDeletionTimestamp ().IsZero () {
7474 instanceStatusObj := l .Spreader ().MustToRuntimeObjectSpreadReconcileStatusInterface (instance , log )
7575 generationChanged = instance .GetGeneration () != instanceStatusObj .GetObservedGeneration ()
7676 isAfterNextReconcileTime := v1 .Now ().UTC ().After (instanceStatusObj .GetNextReconcileTime ().UTC ())
77- refreshRequested := slices .Contains (maps .Keys (instance .GetLabels ()), spread .SpreadReconcileRefreshLabel )
77+ refreshRequested := slices .Contains (maps .Keys (instance .GetLabels ()), spread .ReconcileRefreshLabel )
7878
7979 reconcileRequired := generationChanged || isAfterNextReconcileTime || refreshRequested
8080 if ! reconcileRequired {
@@ -111,23 +111,23 @@ func Reconcile(ctx context.Context, req ctrl.Request, instance runtimeobject.Run
111111 }
112112
113113 // Continue with reconciliation
114- for _ , subroutine := range subroutines {
114+ for _ , s := range subroutines {
115115 if l .ConditionsManager () != nil {
116- l .ConditionsManager ().SetSubroutineConditionToUnknownIfNotSet (& condArr , subroutine , inDeletion , log )
116+ l .ConditionsManager ().SetSubroutineConditionToUnknownIfNotSet (& condArr , s , inDeletion , log )
117117 }
118118
119- // Set current condArr before reconciling the subroutine
119+ // Set current condArr before reconciling the s
120120 if l .ConditionsManager () != nil {
121121 l .ConditionsManager ().MustToRuntimeObjectConditionsInterface (instance , log ).SetConditions (condArr )
122122 }
123- subResult , retry , err := reconcileSubroutine (ctx , instance , subroutine , cl , l , log , generationChanged , sentryTags )
124- // Update condArr with any changes the subroutine did
123+ subResult , retry , err := reconcileSubroutine (ctx , instance , s , cl , l , log , generationChanged , sentryTags )
124+ // Update condArr with any changes the s did
125125 if l .ConditionsManager () != nil {
126126 condArr = l .ConditionsManager ().MustToRuntimeObjectConditionsInterface (instance , log ).GetConditions ()
127127 }
128128 if err != nil {
129129 if l .ConditionsManager () != nil {
130- l .ConditionsManager ().SetSubroutineCondition (& condArr , subroutine , result , err , inDeletion , log )
130+ l .ConditionsManager ().SetSubroutineCondition (& condArr , s , result , err , inDeletion , log )
131131 l .ConditionsManager ().SetInstanceConditionReady (& condArr , v1 .ConditionFalse )
132132 l .ConditionsManager ().MustToRuntimeObjectConditionsInterface (instance , log ).SetConditions (condArr )
133133 }
@@ -149,7 +149,7 @@ func Reconcile(ctx context.Context, req ctrl.Request, instance runtimeobject.Run
149149 }
150150 if l .ConditionsManager () != nil {
151151 if subResult .RequeueAfter == 0 {
152- l .ConditionsManager ().SetSubroutineCondition (& condArr , subroutine , subResult , err , inDeletion , log )
152+ l .ConditionsManager ().SetSubroutineCondition (& condArr , s , subResult , err , inDeletion , log )
153153 }
154154 }
155155 }
@@ -340,9 +340,9 @@ func AddFinalizersIfNeeded(ctx context.Context, cl client.Client, instance runti
340340
341341 update := false
342342 original := instance .DeepCopyObject ().(client.Object )
343- for _ , subroutine := range subroutines {
344- if len (subroutine .Finalizers ()) > 0 {
345- needsUpdate := AddFinalizerIfNeeded (instance , subroutine )
343+ for _ , s := range subroutines {
344+ if len (s .Finalizers ()) > 0 {
345+ needsUpdate := AddFinalizerIfNeeded (instance , s )
346346 if needsUpdate {
347347 update = true
348348 }
0 commit comments