Documentation
¶
Overview ¶
Package celenv evaluates function celCondition expressions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitCELEnvironment ¶
func InitCELEnvironment(opts *runneroptions.RunnerOptions) error
InitCELEnvironment initializes the CEL environment for condition evaluation. Call it after RunnerOptions.InitDefaults. A failure to create the environment is returned so callers can decide how to surface it.
Types ¶
type CELEnvironment ¶
type CELEnvironment struct {
// contains filtered or unexported fields
}
CELEnvironment holds a shared CEL environment for evaluating conditions. The environment is created once and reused; programs are compiled per condition call.
func NewCELEnvironment ¶
func NewCELEnvironment() (*CELEnvironment, error)
NewCELEnvironment creates a new CELEnvironment with the standard KRM variable bindings. Includes cel-go built-in extensions (strings, sets, lists, comprehensions) for evaluating CEL expressions against KRM resources.
func (*CELEnvironment) EvaluateCondition ¶
func (e *CELEnvironment) EvaluateCondition(ctx context.Context, celCond string, resources []*yaml.RNode, checkFrequency uint, costLimit uint64) (bool, error)
EvaluateCondition compiles and evaluates a CEL condition against a list of KRM resources. Returns true if the condition is met, false otherwise. An empty condition always returns true (function executes unconditionally).