-
Notifications
You must be signed in to change notification settings - Fork 306
Description
Feature Description
Problem Statement: In pkg/controller/instance/controller_reconcile.go (line 206), a TODO notes that "skipping on error seems un-intuitive." Currently, the logic in reconcileInstance combines evaluation errors and false results into a single skip action.
I have manually verified that when a resource's includeWhen condition contains an invalid CEL expression (e.g., calling a non-existent function), the controller logs a "skip" and the resource simply disappears from the status. This masks critical configuration issues from the user, who might believe the resource was intentionally skipped by logic.
Proposed Solution: Refactor the reconciliation loop to handle errors from ReadyToProcessResource separately.
On Error: If the evaluation fails due to an error (like a CEL syntax or execution error), set the resource state to ResourceStateError and trigger a requeue.
On False: If the evaluation returns false without an error, continue with the current ResourceStateSkipped logic.
Reproduced the "silent skip" behavior on a local Kind cluster using a deliberately broken CEL expression.
Verified that local unit tests for pkg/controller/instance and pkg/runtime pass.
I am ready to submit a PR to address this TODO.