Documentation ¶
Overview ¶
this package is split out to snip links between the API server and the kube resource validation functions
Index ¶
- Constants
- Variables
- func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList
- func ValidateFinalizerName(stringValue string, fldPath *field.Path) field.ErrorList
- func ValidateImmutableField(newVal, oldVal interface{}, fldPath *field.Path) field.ErrorList
- func ValidateNoNewFinalizers(newFinalizers []string, oldFinalizers []string, fldPath *field.Path) field.ErrorList
- func ValidateObjectMeta(meta *metav1.ObjectMeta, requiresNamespace bool, ...) field.ErrorList
- func ValidateObjectMetaUpdate(newMeta, oldMeta *metav1.ObjectMeta, fldPath *field.Path) field.ErrorList
- func ValidateOwnerReferences(ownerReferences []metav1.OwnerReference, fldPath *field.Path) field.ErrorList
Constants ¶
const FieldImmutableErrorMsg string = `field is immutable`
Variables ¶
var BannedOwners = map[schema.GroupVersionKind]struct{}{ v1.SchemeGroupVersion.WithKind("Event"): {}, }
BannedOwners is a black list of object that are not allowed to be owners.
var RepairMalformedUpdates bool = true
TODO: delete this global variable when we enable the validation of common fields by default.
var ValidateClusterName = apimachineyvalidation.NameIsDNS1035Label
ValidateClusterName can be used to check whether the given cluster name is valid.
Functions ¶
func ValidateAnnotations ¶
ValidateAnnotations validates that a set of annotations are correctly defined.
func ValidateFinalizerName ¶
Validate finalizer names
func ValidateImmutableField ¶
func ValidateNoNewFinalizers ¶
func ValidateObjectMeta ¶
func ValidateObjectMeta(meta *metav1.ObjectMeta, requiresNamespace bool, nameFn apimachineyvalidation.ValidateNameFunc, fldPath *field.Path) field.ErrorList
ValidateObjectMeta validates an object's metadata on creation. It expects that name generation has already been performed. It doesn't return an error for rootscoped resources with namespace, because namespace should already be cleared before.
func ValidateObjectMetaUpdate ¶
func ValidateObjectMetaUpdate(newMeta, oldMeta *metav1.ObjectMeta, fldPath *field.Path) field.ErrorList
ValidateObjectMetaUpdate validates an object's metadata when updated
func ValidateOwnerReferences ¶
Types ¶
This section is empty.