Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct { Errors []error InvalidIds object.ObjMetadataSet }
Collector simplifies collecting validation errors from multiple sources and extracting the IDs of the invalid objects.
func (*Collector) Collect ¶
Collect unwraps MultiErrors, adds them to Errors, extracts invalid object IDs from validation.Error, and adds them to InvalidIds.
func (*Collector) FilterInvalidIds ¶
func (c *Collector) FilterInvalidIds(ids object.ObjMetadataSet) object.ObjMetadataSet
FilterInvalidIds returns a set of object ID that does not contain any invalid IDs, based on the collected InvalidIds.
func (*Collector) FilterInvalidObjects ¶
func (c *Collector) FilterInvalidObjects(objs object.UnstructuredSet) object.UnstructuredSet
FilterInvalidObjects returns a set of objects that does not contain any invalid objects, based on the collected InvalidIds.
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
Error wraps an error with the object or objects it applies to.
func (*Error) Identifiers ¶
func (ve *Error) Identifiers() object.ObjMetadataSet
Identifiers returns zero or more object IDs which are invalid.
type Validator ¶
type Validator struct { Mapper meta.RESTMapper Collector *Collector }
Validator contains functionality for validating a set of resources prior to being used by the Apply functionality. This imposes some constraint not always required, such as namespaced resources must have the namespace set.
func (*Validator) Validate ¶
func (v *Validator) Validate(objs []*unstructured.Unstructured)
Validate validates the provided resources. A RESTMapper will be used to fetch type information from the live cluster.