@@ -229,10 +229,8 @@ func (r *HTTPRouteReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
229229 // Resource templates may reference each other, with
230230 // the worst-case being a strictly linear DAG. This
231231 // means that we may have to loop N times, with N
232- // being the number of resources. We break the loop
233- // when we no longer make progress.
234- var lastRenderedNum , renderedNum , existsNum int
235- lastRenderedNum = - 1
232+ // being the number of resources.
233+ var renderedNum , existsNum int
236234 for attempt := 0 ; attempt < len (templates ); attempt ++ {
237235 logger .Info ("start reconcile loop" , "attempt" , attempt )
238236 isFinalAttempt := attempt == len (templates )- 1
@@ -242,19 +240,13 @@ func (r *HTTPRouteReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
242240 renderedNum , existsNum = renderTemplates (ctx , r , & rt , templates , & templateValues , isFinalAttempt )
243241 logger .Info ("Rendered" , "rendered" , renderedNum , "exists" , existsNum )
244242
245- if renderedNum == lastRenderedNum {
246- logger .Info ("breaking render/apply loop" , "renderedNum" , renderedNum , "totalNum" , len (templates ))
247- break
248- }
249-
250243 if err := applyTemplates (ctx , r , & rt , templates ); err != nil {
251244 return ctrl.Result {}, fmt .Errorf ("unable to apply templates: %w" , err )
252245 }
253- lastRenderedNum = renderedNum
254246 }
255247 // If we haven't already decided to requeue, then requeue if not all templates could render (possibly a missing dependency)
256248 requeue = requeue || (renderedNum != len (templates ))
257- logger .Info ("ending reconcile loop" , "renderedNum" , renderedNum , "lastRenderedNum" , lastRenderedNum , " totalNum" , len (templates ), "requeue" , requeue )
249+ logger .Info ("ending reconcile loop" , "renderedNum" , renderedNum , "totalNum" , len (templates ), "requeue" , requeue )
258250
259251 // FIXME errors in templating and status of sub-resources in general should set status conditions
260252
0 commit comments