genericvalidation

package
v1.6.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 30, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const FieldImmutableErrorMsg string = `field is immutable`

Variables

View Source
var BannedOwners = map[schema.GroupVersionKind]struct{}{
	v1.SchemeGroupVersion.WithKind("Event"): {},
}

BannedOwners is a black list of object that are not allowed to be owners.

View Source
var RepairMalformedUpdates bool = true

TODO: delete this global variable when we enable the validation of common fields by default.

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

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL