celenv

package
v1.0.2-pre.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL