apiextensions-apiserverk8s.io/apiextensions-apiserver/pkg/apiserver/validation Index | Files

package validation

import "k8s.io/apiextensions-apiserver/pkg/apiserver/validation"

Index

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. postProcess is never called for nil schemas.

func NewSchemaValidator

func NewSchemaValidator(customResourceValidation *apiextensions.CustomResourceValidation) (*validate.SchemaValidator, *spec.Schema, error)

NewSchemaValidator creates an openapi schema validator for the given CRD validation.

func StripUnsupportedFormatsPostProcess

func StripUnsupportedFormatsPostProcess(s *spec.Schema) error

StripUnsupportedFormatsPostProcess sets unsupported formats to empty string.

func ValidateCustomResource

func ValidateCustomResource(fldPath *field.Path, customResource interface{}, validator *validate.SchemaValidator) field.ErrorList

ValidateCustomResource validates the Custom Resource against the schema in the CustomResourceDefinition. CustomResource is a JSON data structure.

Types

type PostProcessFunc

type PostProcessFunc func(*spec.Schema) error

PostProcessFunc post-processes one node of a spec.Schema.

Source Files

formats.go validation.go

Version
v0.20.6-rc.0
Published
Mar 18, 2021
Platform
js/wasm
Imports
9 packages
Last checked
9 minutes ago

Tools for package owners.