kubernetesk8s.io/kubernetes/pkg/api/validation/genericvalidation Index | Files

package genericvalidation

import "k8s.io/kubernetes/pkg/api/validation/genericvalidation"

this package is split out to snip links between the API server and the kube resource validation functions

Index

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

func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList

ValidateAnnotations validates that a set of annotations are correctly defined.

func ValidateFinalizerName

func ValidateFinalizerName(stringValue string, fldPath *field.Path) field.ErrorList

Validate finalizer names

func ValidateImmutableField

func ValidateImmutableField(newVal, oldVal interface{}, fldPath *field.Path) field.ErrorList

func ValidateNoNewFinalizers

func ValidateNoNewFinalizers(newFinalizers []string, oldFinalizers []string, fldPath *field.Path) field.ErrorList

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

func ValidateOwnerReferences(ownerReferences []metav1.OwnerReference, fldPath *field.Path) field.ErrorList

Source Files

doc.go objectmeta.go

Version
v1.6.0-alpha.1
Published
Jan 30, 2017
Platform
darwin/amd64
Imports
12 packages
Last checked
2 minutes ago

Tools for package owners.