cel

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldValidatorsFromFile

func FieldValidatorsFromFile(t *testing.T, crdFilePath string) (validatorsByVersionByJSONPath map[string]map[string]CELValidateFunc)

FieldValidatorsFromFile extracts the CEL validators by version and JSONPath from a CRD file and returns a validator func for testing against samples.

func PatternValidatorsFromFile

func PatternValidatorsFromFile(t *testing.T, crdFilePath string) (validatorsByVersionByJSONPath map[string]map[string]PatternValidateFunc)

PatternValidatorsFromFile extracts the CEL validators by version and JSONPath from a CRD file and returns a validator func for testing against samples.

func VersionValidatorsFromFile

func VersionValidatorsFromFile(t *testing.T, crdFilePath string) map[string]CELValidateFunc

VersionValidatorsFromFile extracts the CEL validators by version from a CRD file and returns a validator func for testing against samples.

Types

type CELValidateFunc

type CELValidateFunc func(obj, old interface{}) field.ErrorList

CELValidateFunc tests a sample object against a CEL validator.

func VersionValidatorFromFile

func VersionValidatorFromFile(t *testing.T, crdFilePath string, version string) (CELValidateFunc, error)

VersionValidatorFromFile extracts the CEL validators for a given version from a CRD file and returns a validator func for testing against samples.

type PatternValidateFunc

type PatternValidateFunc func(obj interface{}) error

Directories

Path Synopsis
Package fake contains API Schema definitions for the resource v1alpha1 API group +kubebuilder:object:generate=true +groupName=test.mongodb.com
Package fake contains API Schema definitions for the resource v1alpha1 API group +kubebuilder:object:generate=true +groupName=test.mongodb.com

Jump to

Keyboard shortcuts

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