Documentation ¶
Index ¶
- Constants
- Variables
- func NameIsDNS952Label(name string, prefix bool) []string
- func NameIsDNSLabel(name string, prefix bool) []string
- func NameIsDNSSubdomain(name string, prefix bool) []string
- func NameIsValidPodName(name string, prefix bool) []string
- func ValidateAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList
- func ValidateDNS1123Label(value string, fldPath *field.Path) field.ErrorList
- func ValidateDNS1123Subdomain(value string, fldPath *field.Path) field.ErrorList
- func ValidateFileExists(path string, fldPath *field.Path) field.ErrorList
- func ValidateGPUSpec(gpuStr string, fldPath *field.Path) field.ErrorList
- func ValidateInstanceType(instanceType string, fldPath *field.Path) field.ErrorList
- func ValidateLabelName(labelName string, fldPath *field.Path) field.ErrorList
- func ValidateLabelSelector(ps *api.LabelSelector, fldPath *field.Path) field.ErrorList
- func ValidateLabelSelectorRequirement(sr api.LabelSelectorRequirement, fldPath *field.Path) field.ErrorList
- func ValidateLabels(labels map[string]string, fldPath *field.Path) field.ErrorList
- func ValidateNode(node *api.Node) field.ErrorList
- func ValidateNonnegativeField(value int64, fldPath *field.Path) field.ErrorList
- func ValidateObjectMeta(meta *api.ObjectMeta, requiresNamespace bool, nameFn ValidateNameFunc, ...) field.ErrorList
- func ValidatePod(pod *api.Pod) field.ErrorList
- func ValidatePodAnnotations(annotations map[string]string, fldPath *field.Path) field.ErrorList
- func ValidatePodSpec(spec *api.PodSpec, fldPath *field.Path) field.ErrorList
- func ValidatePositiveField(value int, fldPath *field.Path) field.ErrorList
- func ValidateResourceParses(resourceStr string, fldPath *field.Path) field.ErrorList
- type StatefulValidator
- type ValidateNameFunc
- type ValidationError
Constants ¶
const RestAPIPort = 6421
Variables ¶
var ValidateNodeName = NameIsDNSSubdomain
var ValidatePodName = NameIsValidPodName
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 NameIsDNS952Label ¶
NameIsDNS952Label 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 NameIsValidPodName ¶
Pod names are unique, they get to have slashes in them
func ValidateAnnotations ¶
ValidateAnnotations validates that a set of annotations are correctly defined.
func ValidateDNS1123Label ¶
func ValidateGPUSpec ¶ added in v0.0.6
func ValidateInstanceType ¶
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 ValidateNode ¶
ValidateNode tests if required fields in the node are set.
func ValidateNonnegativeField ¶
Validates that given value is not negative.
func ValidateObjectMeta ¶
func ValidateObjectMeta(meta *api.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 ValidatePod ¶
ValidatePod tests if required fields in the pod are set.
func ValidatePodAnnotations ¶
ValidatePodAnnotations validates pod annotations.
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 ValidatePositiveField ¶
Validates that given value is not negative.
Types ¶
type StatefulValidator ¶
type StatefulValidator struct {
// contains filtered or unexported fields
}
func NewStatefulValidator ¶
func NewStatefulValidator(cloudProvider string, vpcCIDRs []string) *StatefulValidator
func (*StatefulValidator) ValidatePodSpec ¶
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.
type ValidationError ¶
type ValidationError struct {
// contains filtered or unexported fields
}
+k8s:deepcopy-gen=false
func (ValidationError) Error ¶
func (e ValidationError) Error() string