Skip to content

Fix hash evaluation#1659

Merged
gianlucam76 merged 1 commit intoprojectsveltos:mainfrom
gianlucam76:fix-hash-evaluation
Mar 20, 2026
Merged

Fix hash evaluation#1659
gianlucam76 merged 1 commit intoprojectsveltos:mainfrom
gianlucam76:fix-hash-evaluation

Conversation

@gianlucam76
Copy link
Member

@gianlucam76 gianlucam76 commented Mar 19, 2026

If hash evaluation fails because of missing referenced resource,
continue by returning nil instead of failing.
This will make sure the error is reported in the clusterSummary
status.

This PR also changes the logic in clusterSummary controller scope.Close()
When a conflict is detected in scope.Close(), instead of returning nothing,
set result = ctrl.Result{RequeueAfter: time.Minute}.

This ensures re-reconciliation without bypassing the NextReconcileTime
backoff (since on the success path no setNextReconcileTime is called,
so skipReconciliation won't block the 1-minute requeue)

Test failure in the tier-change scenario:

  1. Tier changes → ClusterSummary spec updated → reconcile fires
  2. Deployment succeeds (no setNextReconcileTime called on success path → no cooldown set)
  3. scope.Close() tries to patch status → conflict (the ClusterSummary
    was modified between read and patch by the controller's own in-flight logic)
  4. Old (pre PR): conflict swallowed → no requeue scheduled, no watch event comes → status
    never reaches Provisioned → test times out

@gianlucam76 gianlucam76 force-pushed the fix-hash-evaluation branch 7 times, most recently from 25cbc0d to d6edf54 Compare March 20, 2026 12:25
If hash evaluation fails because of missing referenced resource,
continue by returning nil instead of failing.
This will make sure the error is reported in the clusterSummary
status.

This PR also changes the logic in clusterSummary controller `scope.Close()`
When a conflict is detected in scope.Close(), instead of returning nothing,
set `result = ctrl.Result{RequeueAfter: time.Minute}`.

This ensures re-reconciliation without bypassing the NextReconcileTime
backoff (since on the success path no setNextReconcileTime is called,
so skipReconciliation won't block the 1-minute requeue)

Test failure in the tier-change scenario:
1. Tier changes → ClusterSummary spec updated → reconcile fires
2. Deployment succeeds (no setNextReconcileTime called on success path → no cooldown set)
3. scope.Close() tries to patch status → conflict (the ClusterSummary
was modified between read and patch by the controller's own in-flight logic)
4. Old (pre PR): conflict swallowed → no requeue scheduled, no watch event comes → status
never reaches Provisioned → test times out
@gianlucam76 gianlucam76 force-pushed the fix-hash-evaluation branch from d6edf54 to 5499734 Compare March 20, 2026 16:43
@gianlucam76 gianlucam76 merged commit 35368b2 into projectsveltos:main Mar 20, 2026
16 checks passed
@gianlucam76 gianlucam76 deleted the fix-hash-evaluation branch March 20, 2026 19:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant