const IsNegativeErrorMsg … type ValidateNameFunc … // NameIsDNSSubdomain is a ValidateNameFunc for names that must be a DNS subdomain. func NameIsDNSSubdomain(name string, prefix bool) []string { … } // NameIsDNSLabel is a ValidateNameFunc for names that must be a DNS 1123 label. func NameIsDNSLabel(name string, prefix bool) []string { … } // NameIsDNS1035Label is a ValidateNameFunc for names that must be a DNS 952 label. func NameIsDNS1035Label(name string, prefix bool) []string { … } var ValidateNamespaceName … var ValidateServiceAccountName … // maskTrailingDash replaces the final character of a string with a subdomain safe // value if it is a dash and if the length of this string is greater than 1. Note that // this is used when a value could be appended to the string, see ValidateNameFunc // for more info. func maskTrailingDash(name string) string { … } // ValidateNonnegativeField validates that given value is not negative. func ValidateNonnegativeField(value int64, fldPath *field.Path) field.ErrorList { … }