Skip to content

Commit 4383639

Browse files
chore: add missing resource status markers for reconciliation process (#768)
previously if the resources were not ready in the apply, we did not set the resource state correctly because the marker updates were missing.
1 parent 40f73de commit 4383639

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/controller/instance/controller_reconcile.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,24 +261,29 @@ func (igr *instanceGraphReconciler) reconcileInstance(ctx context.Context) error
261261
}
262262

263263
if err != nil {
264+
mark.ResourcesNotReady("failed to reconcile the apply set: %v", err)
264265
return igr.delayedRequeue(fmt.Errorf("failed to apply/prune resources: %w", err))
265266
}
266267

267268
// Inspect resource states and return error if any resource is in error state
268269
if err := igr.state.ResourceErrors(); err != nil {
270+
mark.ResourcesNotReady("at least one resource reports an error: %v", err)
269271
return igr.delayedRequeue(err)
270272
}
271273

272274
if err := result.Errors(); err != nil {
275+
mark.ResourcesNotReady("there was an error while reconciling resources in the apply set: %v", err)
273276
return fmt.Errorf("failed to apply/prune resources: %w", err)
274277
}
275278

276279
if unresolvedResourceID != "" {
280+
mark.ResourcesInProgress("waiting for resource resolution: %s", unresolvedResourceID)
277281
return igr.delayedRequeue(fmt.Errorf("unresolved resource: %s", unresolvedResourceID))
278282
}
279283

280284
// If there are any cluster mutations, we need to requeue.
281285
if result.HasClusterMutation() {
286+
mark.ResourcesInProgress("reconciling cluster mutation after apply")
282287
return igr.delayedRequeue(fmt.Errorf("changes applied to cluster"))
283288
}
284289

0 commit comments

Comments
 (0)