Documentation ¶
Index ¶
- func FieldValidatorsFromFile(t *testing.T, crdFilePath string) (validatorsByVersionByJSONPath map[string]map[string]CELValidateFunc)
- func PatternValidatorsFromFile(t *testing.T, crdFilePath string) (validatorsByVersionByJSONPath map[string]map[string]PatternValidateFunc)
- func VersionValidatorsFromFile(t *testing.T, crdFilePath string) map[string]CELValidateFunc
- type CELValidateFunc
- type PatternValidateFunc
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 ¶
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