test

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldValidatorsFromFile added in v0.11.0

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 added in v0.10.0

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 added in v0.11.0

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 added in v0.11.0

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 added in v0.10.0

type PatternValidateFunc func(obj interface{}) error

Jump to

Keyboard shortcuts

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