cel

package
v1.22.3 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 7 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(schema *spec.Schema, values any) ([]error, error)

Validate evaluates all x-deckhouse-validations CEL rules attached to schema and its nested properties recursively without any previous-value context. Rules that reference oldSelf (transition rules) are skipped.

It is equivalent to ValidateTransition(schema, values, nil) and is preserved as a thin wrapper for callers that don't have access to the previous values.

func ValidateTransition added in v1.20.10

func ValidateTransition(schema *spec.Schema, values, oldValues any) ([]error, error)

ValidateTransition evaluates all x-deckhouse-validations CEL rules attached to schema and its nested properties recursively, exposing the current value as "self" and the previous value as "oldSelf" inside expressions.

Rules referencing oldSelf are treated as transition rules: they are evaluated only when an old value is available at the same level (i.e. on updates) and silently skipped otherwise (e.g. on create or for newly added properties). This mirrors the semantics of x-kubernetes-validations and allows expressing immutability with a rule like:

x-deckhouse-validations:
  - expression: "self == oldSelf"
    message: "field is immutable"

It returns validation errors for every rule that evaluated to false, and a non-nil error for configuration or evaluation failures.

Types

This section is empty.

Jump to

Keyboard shortcuts

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