@@ -176,7 +176,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req runtime.Request) (runtim
176176 return runtime.Result {}, r .recordUpdateRunSucceeded (ctx , updateRun )
177177 }
178178
179- return r .handleIncompleteUpdateRun (ctx , updateRun , waitTime , execErr , state , runObjRef )
179+ return r .updateUpdateRunStatus (ctx , updateRun , waitTime , execErr , state , runObjRef )
180180 case placementv1beta1 .StateStop :
181181 // Stop the updateRun.
182182 klog .V (2 ).InfoS ("Stopping the updateRun" , "state" , state , "updatingStageIndex" , updatingStageIndex , "updateRun" , runObjRef )
@@ -191,7 +191,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req runtime.Request) (runtim
191191 return runtime.Result {}, r .recordUpdateRunStopped (ctx , updateRun )
192192 }
193193
194- return r .handleIncompleteUpdateRun (ctx , updateRun , waitTime , stopErr , state , runObjRef )
194+ return r .updateUpdateRunStatus (ctx , updateRun , waitTime , stopErr , state , runObjRef )
195195
196196 default :
197197 // Initialize, Run, or Stop are the only supported states.
@@ -202,7 +202,7 @@ func (r *Reconciler) Reconcile(ctx context.Context, req runtime.Request) (runtim
202202 return runtime.Result {}, nil
203203}
204204
205- func (r * Reconciler ) handleIncompleteUpdateRun (ctx context.Context , updateRun placementv1beta1.UpdateRunObj , waitTime time.Duration , err error , state placementv1beta1.State , runObjRef klog.ObjectRef ) (runtime.Result , error ) {
205+ func (r * Reconciler ) updateUpdateRunStatus (ctx context.Context , updateRun placementv1beta1.UpdateRunObj , waitTime time.Duration , err error , state placementv1beta1.State , runObjRef klog.ObjectRef ) (runtime.Result , error ) {
206206 // The execution or stopping is not finished yet or it encounters a retriable error.
207207 // We need to record the status and requeue.
208208 if updateErr := r .recordUpdateRunStatus (ctx , updateRun ); updateErr != nil {
@@ -211,6 +211,7 @@ func (r *Reconciler) handleIncompleteUpdateRun(ctx context.Context, updateRun pl
211211
212212 klog .V (2 ).InfoS ("The updateRun is not finished yet" , "state" , state , "requeueWaitTime" , waitTime , "err" , err , "updateRun" , runObjRef )
213213
214+ // Return execution or stopping retriable error if any.
214215 if err != nil {
215216 return runtime.Result {}, err
216217 }
0 commit comments