Skip to content

[REFACTOR] Distinguish between CEL evaluation errors and skips in Instance Controller #924

@deepith-18

Description

@deepith-18

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.

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions