Documentation ¶
Index ¶
- Constants
- Variables
- func AccumulateUniqueHostPorts(containers []v1.Container, accumulator *sets.String, fldPath *field.Path) field.ErrorList
- func GetVolumeMountMap(mounts []v1.VolumeMount) map[string]string
- func IsMatchedVolume(name string, volumes map[string]v1.VolumeSource) bool
- func NameIsDNS1035Label(name string, prefix bool) []string
- func NameIsDNSLabel(name string, prefix bool) []string
- func NameIsDNSSubdomain(name string, prefix bool) []string
- func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList
- func ValidateContainerUpdates(newContainers, oldContainers []v1.Container, fldPath *field.Path) (allErrs field.ErrorList, stop bool)
- func ValidateDNS1123Label(value string, fldPath *field.Path) field.ErrorList
- func ValidateDNS1123Subdomain(value string, fldPath *field.Path) field.ErrorList
- func ValidateEnv(vars []v1.EnvVar, fldPath *field.Path) field.ErrorList
- func ValidateImmutableField(newVal, oldVal interface{}, fldPath *field.Path) field.ErrorList
- func ValidateLabelName(labelName string, fldPath *field.Path) field.ErrorList
- func ValidateLabelSelector(ps *v1.LabelSelector, fldPath *field.Path) field.ErrorList
- func ValidateLabelSelectorRequirement(sr v1.LabelSelectorRequirement, fldPath *field.Path) field.ErrorList
- func ValidateLabels(labels map[string]string, fldPath *field.Path) field.ErrorList
- func ValidateNonnegativeField(value int64, fldPath *field.Path) field.ErrorList
- func ValidateObjectMeta(objMeta *metav1.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, ...) field.ErrorList
- func ValidateObjectMetaAccessor(meta metav1.Object, requiresNamespace bool, nameFn ValidateNameFunc, ...) field.ErrorList
- func ValidateObjectMetaAccessorUpdate(newMeta, oldMeta metav1.Object, fldPath *field.Path) field.ErrorList
- func ValidateObjectMetaUpdate(newMeta, oldMeta *metav1.ObjectMeta, fldPath *field.Path) field.ErrorList
- func ValidateOwnerReferences(ownerReferences []metav1.OwnerReference, fldPath *field.Path) field.ErrorList
- func ValidatePod(pod *v1.Pod) field.ErrorList
- func ValidatePodSecurityContext(securityContext *v1.PodSecurityContext, fldPath *field.Path) field.ErrorList
- func ValidatePodSpec(spec *v1.PodSpec, fldPath *field.Path) field.ErrorList
- func ValidatePodSpecificAnnotationUpdates(newPod, oldPod *v1.Pod, fldPath *field.Path) field.ErrorList
- func ValidatePodSpecificAnnotations(annotations map[string]string, spec *v1.PodSpec, fldPath *field.Path) field.ErrorList
- func ValidatePodTemplateSpecForStatefulSet(template *v1.PodTemplateSpec, fldPath *field.Path) field.ErrorList
- func ValidatePodUpdate(newPod, oldPod *v1.Pod) field.ErrorList
- func ValidateResourceRequirements(requirements *v1.ResourceRequirements, fldPath *field.Path) field.ErrorList
- func ValidateSecurityContext(sc *v1.SecurityContext, fldPath *field.Path) field.ErrorList
- func ValidateStatefulSet(statefulSet *v1.StatefulSet) field.ErrorList
- func ValidateStatefulSetName(name string, prefix bool) []string
- func ValidateStatefulSetSpec(spec *v1.StatefulSetSpec, fldPath *field.Path) field.ErrorList
- func ValidateStatefulSetStatusUpdate(statefulSet, oldStatefulSet *v1.StatefulSet) field.ErrorList
- func ValidateStatefulSetUpdate(statefulSet, oldStatefulSet *v1.StatefulSet) field.ErrorList
- func ValidateVolumeMounts(mounts []v1.VolumeMount, volumes map[string]v1.VolumeSource, ...) field.ErrorList
- func ValidateVolumes(volumes []v1.Volume, fldPath *field.Path) (map[string]v1.VolumeSource, field.ErrorList)
- type ValidateNameFunc
Constants ¶
const FieldImmutableErrorMsg string = `field is immutable`
const IsNegativeErrorMsg string = `must be greater than or equal to 0`
Variables ¶
var BannedOwners = map[string]struct{}{
"event": {},
}
BannedOwners is a black list of object that are not allowed to be owners.
var ValidateNamespaceName = NameIsDNSLabel
ValidateNamespaceName can be used to check whether the given namespace name is valid. Prefix indicates this name will be used as part of generation, in which case trailing dashes are allowed.
var ValidateNodeName = NameIsDNSSubdomain
var ValidatePodName = NameIsDNSSubdomain
var ValidateServiceAccountName = NameIsDNSSubdomain
ValidateServiceAccountName can be used to check whether the given service account name is valid. Prefix indicates this name will be used as part of generation, in which case trailing dashes are allowed.
Functions ¶
func AccumulateUniqueHostPorts ¶
func AccumulateUniqueHostPorts(containers []v1.Container, accumulator *sets.String, fldPath *field.Path) field.ErrorList
AccumulateUniqueHostPorts extracts each HostPort of each Container, accumulating the results and returning an error if any ports conflict.
func GetVolumeMountMap ¶
func GetVolumeMountMap(mounts []v1.VolumeMount) map[string]string
func IsMatchedVolume ¶
func IsMatchedVolume(name string, volumes map[string]v1.VolumeSource) bool
func NameIsDNS1035Label ¶
NameIsDNS1035Label is a ValidateNameFunc for names that must be a DNS 952 label.
func NameIsDNSLabel ¶
NameIsDNSLabel is a ValidateNameFunc for names that must be a DNS 1123 label.
func NameIsDNSSubdomain ¶
NameIsDNSSubdomain is a ValidateNameFunc for names that must be a DNS subdomain.
func ValidateAnnotations ¶
ValidateAnnotations validates that a set of annotations are correctly defined.
func ValidateDNS1123Label ¶
func ValidateDNS1123Subdomain ¶
ValidateDNS1123Subdomain validates that a name is a proper DNS subdomain.
func ValidateEnv ¶
ValidateEnv validates env vars
func ValidateImmutableField ¶
ValidateImmutableField validates the new value and the old value are deeply equal.
func ValidateLabelName ¶
ValidateLabelName validates that the label name is correctly defined.
func ValidateLabelSelector ¶
func ValidateLabels ¶
ValidateLabels validates that a set of labels are correctly defined.
func ValidateNonnegativeField ¶
ValidateNonnegativeField Validates that given value is not negative.
func ValidateObjectMeta ¶
func ValidateObjectMeta(objMeta *metav1.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, fldPath *field.Path) field.ErrorList
func ValidateObjectMetaAccessorUpdate ¶
func ValidateObjectMetaAccessorUpdate(newMeta, oldMeta metav1.Object, fldPath *field.Path) field.ErrorList
ValidateObjectMetaAccessorUpdate validates an object's metadata when updated.
func ValidateOwnerReferences ¶
func ValidatePodSecurityContext ¶
func ValidatePodSecurityContext(securityContext *v1.PodSecurityContext, fldPath *field.Path) field.ErrorList
ValidatePodSecurityContext test that the specified PodSecurityContext has valid data.
func ValidatePodSpec ¶
ValidatePodSpec tests that the specified PodSpec has valid data. This includes checking formatting and uniqueness. It also canonicalizes the structure by setting default values and implementing any backwards-compatibility tricks.
func ValidateSecurityContext ¶
ValidateSecurityContext ensure the security context contains valid settings
func ValidateStatefulSet ¶
func ValidateStatefulSet(statefulSet *v1.StatefulSet) field.ErrorList
ValidateStatefulSet validates a StatefulSet.
func ValidateStatefulSetName ¶
func ValidateStatefulSetSpec ¶
ValidateStatefulSetSpec tests if required fields in the StatefulSet spec are set.
func ValidateStatefulSetStatusUpdate ¶
func ValidateStatefulSetStatusUpdate(statefulSet, oldStatefulSet *v1.StatefulSet) field.ErrorList
ValidateStatefulSetStatusUpdate tests if required fields in the StatefulSet are set.
func ValidateStatefulSetUpdate ¶
func ValidateStatefulSetUpdate(statefulSet, oldStatefulSet *v1.StatefulSet) field.ErrorList
ValidateStatefulSetUpdate tests if required fields in the StatefulSet are set.
func ValidateVolumeMounts ¶
func ValidateVolumeMounts(mounts []v1.VolumeMount, volumes map[string]v1.VolumeSource, fldPath *field.Path) field.ErrorList
Types ¶
type ValidateNameFunc ¶
ValidateNameFunc validates that the provided name is valid for a given resource type. Not all resources have the same validation rules for names. Prefix is true if the name will have a value appended to it. If the name is not valid, this returns a list of descriptions of individual characteristics of the value that were not valid. Otherwise, this returns an empty list or nil.