Documentation ¶
Overview ¶
Package validation contains generic api type validation functions.
Index ¶
Constants ¶
const IsNegativeErrorMsg string = `must be greater than or equal to 0`
Variables ¶
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 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 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.
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.