common

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0, BSD-2-Clause, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ObjectNameField = "metadata.name"

ObjectNameField field has the field path to the metadata name field.

Variables

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.

ValidateNodeName can be used to check whether the given node name is valid. Prefix indicates this name will be used as part of generation, in which case trailing dashes are allowed.

ValidatePodName can be used to check whether the given pod name is valid. Prefix indicates this name will be used as part of generation, in which case trailing dashes are allowed.

Functions

func IsStandardFinalizerName

func IsStandardFinalizerName(str string) bool

IsStandardFinalizerName checks if the input string is a standard finalizer name

func ValidateAffinity

func ValidateAffinity(affinity *core.Affinity, fldPath *field.Path) field.ErrorList

ValidateAffinity checks if given affinities are valid

func ValidateNodeFieldSelectorRequirement

func ValidateNodeFieldSelectorRequirement(req core.NodeSelectorRequirement, fldPath *field.Path) field.ErrorList

ValidateNodeFieldSelectorRequirement tests that the specified NodeSelectorRequirement fields has valid data

func ValidateNodeSelector

func ValidateNodeSelector(nodeSelector *core.NodeSelector, fldPath *field.Path) field.ErrorList

ValidateNodeSelector tests that the specified nodeSelector fields has valid data

func ValidateNodeSelectorRequirement

func ValidateNodeSelectorRequirement(rq core.NodeSelectorRequirement, fldPath *field.Path) field.ErrorList

ValidateNodeSelectorRequirement tests that the specified NodeSelectorRequirement fields has valid data

func ValidateNodeSelectorTerm

func ValidateNodeSelectorTerm(term core.NodeSelectorTerm, fldPath *field.Path) field.ErrorList

ValidateNodeSelectorTerm tests that the specified node selector term has valid data

func ValidateObjectMeta

func ValidateObjectMeta(meta *metav1.ObjectMeta, requiresNamespace bool, nameFn 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. TODO: Remove calls to this method scattered in validations of specific resources, e.g., ValidatePodUpdate.

func ValidatePreferredSchedulingTerms

func ValidatePreferredSchedulingTerms(terms []core.PreferredSchedulingTerm, fldPath *field.Path) field.ErrorList

ValidatePreferredSchedulingTerms tests that the specified SoftNodeAffinity fields has valid data

func ValidateTolerations

func ValidateTolerations(tolerations []core.Toleration, fldPath *field.Path) field.ErrorList

ValidateTolerations tests if given tolerations have valid data.

Types

type FinalizerName

type FinalizerName string

FinalizerName is the name identifying a finalizer during namespace lifecycle.

const FinalizerKubernetes FinalizerName = "kubernetes"

FinalizerKubernetes denotes the kubernetes finalizer.

type PodSchedulingPolicyConfiguration

type PodSchedulingPolicyConfiguration interface {
	runtime.Object
	GetNodeSelector() map[string]string
	GetNodeName() string
	GetAffinity() *corev1.Affinity
	GetSchedulerName() string
	GetTolerations() []corev1.Toleration
}

PodSchedulingPolicyConfiguration describes the interface for scheduling policy configuration.

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.

Jump to

Keyboard shortcuts

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