test

package
v0.33.7 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: Apache-2.0 Imports: 15 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

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

Jump to

Keyboard shortcuts

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