package validation
import "k8s.io/apiextensions-apiserver/pkg/apiserver/validation"
Index ¶
- func ConvertJSONSchemaProps(in *apiextensions.JSONSchemaProps, out *spec.Schema) error
- func ConvertJSONSchemaPropsWithPostProcess(in *apiextensions.JSONSchemaProps, out *spec.Schema, postProcess PostProcessFunc) error
- func NewSchemaValidator(customResourceValidation *apiextensions.CustomResourceValidation) (*validate.SchemaValidator, *spec.Schema, error)
- func ValidateCustomResource(customResource interface{}, validator *validate.SchemaValidator) error
- type PostProcessFunc
Functions ¶
func ConvertJSONSchemaProps ¶
func ConvertJSONSchemaProps(in *apiextensions.JSONSchemaProps, out *spec.Schema) error
ConvertJSONSchemaProps converts the schema from apiextensions.JSONSchemaPropos to go-openapi/spec.Schema.
func ConvertJSONSchemaPropsWithPostProcess ¶
func ConvertJSONSchemaPropsWithPostProcess(in *apiextensions.JSONSchemaProps, out *spec.Schema, postProcess PostProcessFunc) error
ConvertJSONSchemaPropsWithPostProcess converts the schema from apiextensions.JSONSchemaPropos to go-openapi/spec.Schema and run a post process step on each JSONSchemaProps node.
func NewSchemaValidator ¶
func NewSchemaValidator(customResourceValidation *apiextensions.CustomResourceValidation) (*validate.SchemaValidator, *spec.Schema, error)
NewSchemaValidator creates an openapi schema validator for the given CRD validation.
func ValidateCustomResource ¶
func ValidateCustomResource(customResource interface{}, validator *validate.SchemaValidator) error
ValidateCustomResource validates the Custom Resource against the schema in the CustomResourceDefinition. CustomResource is a JSON data structure.
Types ¶
type PostProcessFunc ¶
PostProcessFunc post-processes one node of a spec.Schema.
Source Files ¶
validation.go
- Version
- v0.15.10
- Published
- Feb 11, 2020
- Platform
- js/wasm
- Imports
- 4 packages
- Last checked
- 59 seconds ago –
Tools for package owners.