Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplySchemaPatches ¶
Types ¶
type DeferredStructural ¶
type DeferredStructural struct { *structuralschema.Structural Properties map[string]*structuralschema.Structural // contains filtered or unexported fields }
DEPRECATED This was a dirty hack to try out using StructuralSchemas against the recursive CRD schema. It actually works pretty well. But k8s doesnt expect recursive schemas and loops forever, so this was dropped. I'm sure it can be simplified a lot, but its complexity does afford some cool properties.
A pointer-based structural schema to workaround the value-typed properties field
type SchemaPatch ¶
type UnstructuredObjectTyper ¶
type UnstructuredObjectTyper struct { Delegate runtime.ObjectTyper UnstructuredTyper runtime.ObjectTyper }
func (UnstructuredObjectTyper) ObjectKinds ¶
func (t UnstructuredObjectTyper) ObjectKinds(obj runtime.Object) ([]schema.GroupVersionKind, bool, error)
func (UnstructuredObjectTyper) Recognizes ¶
func (t UnstructuredObjectTyper) Recognizes(gvk schema.GroupVersionKind) bool
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func (*Validator) Parse ¶
func (s *Validator) Parse(document []byte) (schema.GroupVersionKind, *unstructured.Unstructured, error)
Parse parses JSON or YAML text and parses it into unstructured.Unstructured. Unset fields with defaults in their schema will have the defaults populated.
It will return errors when there is an issue parsing the object, or if it contains fields unknown to the schema, or if the schema was recursive.
func (*Validator) Validate ¶
func (s *Validator) Validate(obj *unstructured.Unstructured) error
Validate takes a parsed resource as input and validates it against its schema.