const qnameCharFmt … const qnameExtCharFmt … const qualifiedNameFmt … const qualifiedNameErrMsg … const qualifiedNameMaxLength … var qualifiedNameRegexp … // IsQualifiedName tests whether the value passed is what Kubernetes calls a // "qualified name". This is a format used in various places throughout the // system. If the value is not valid, a list of error strings is returned. // Otherwise an empty list (or nil) is returned. func IsQualifiedName(value string) []string { … } // IsFullyQualifiedName checks if the name is fully qualified. This is similar // to IsFullyQualifiedDomainName but requires a minimum of 3 segments instead of // 2 and does not accept a trailing . as valid. // TODO: This function is deprecated and preserved until all callers migrate to // IsFullyQualifiedDomainName; please don't add new callers. func IsFullyQualifiedName(fldPath *field.Path, name string) field.ErrorList { … } // IsFullyQualifiedDomainName checks if the domain name is fully qualified. This // is similar to IsFullyQualifiedName but only requires a minimum of 2 segments // instead of 3 and accepts a trailing . as valid. func IsFullyQualifiedDomainName(fldPath *field.Path, name string) field.ErrorList { … } const httpPathFmt … var httpPathRegexp … // IsDomainPrefixedPath checks if the given string is a domain-prefixed path // (e.g. acme.io/foo). All characters before the first "/" must be a valid // subdomain as defined by RFC 1123. All characters trailing the first "/" must // be valid HTTP Path characters as defined by RFC 3986. func IsDomainPrefixedPath(fldPath *field.Path, dpPath string) field.ErrorList { … } const labelValueFmt … const labelValueErrMsg … const LabelValueMaxLength … var labelValueRegexp … // IsValidLabelValue tests whether the value passed is a valid label value. If // the value is not valid, a list of error strings is returned. Otherwise an // empty list (or nil) is returned. func IsValidLabelValue(value string) []string { … } const dns1123LabelFmt … const dns1123LabelErrMsg … const DNS1123LabelMaxLength … var dns1123LabelRegexp … // IsDNS1123Label tests for a string that conforms to the definition of a label in // DNS (RFC 1123). func IsDNS1123Label(value string) []string { … } const dns1123SubdomainFmt … const dns1123SubdomainErrorMsg … const DNS1123SubdomainMaxLength … var dns1123SubdomainRegexp … // IsDNS1123Subdomain tests for a string that conforms to the definition of a // subdomain in DNS (RFC 1123). func IsDNS1123Subdomain(value string) []string { … } const dns1035LabelFmt … const dns1035LabelErrMsg … const DNS1035LabelMaxLength … var dns1035LabelRegexp … // IsDNS1035Label tests for a string that conforms to the definition of a label in // DNS (RFC 1035). func IsDNS1035Label(value string) []string { … } const wildcardDNS1123SubdomainFmt … const wildcardDNS1123SubdomainErrMsg … // IsWildcardDNS1123Subdomain tests for a string that conforms to the definition of a // wildcard subdomain in DNS (RFC 1034 section 4.3.3). func IsWildcardDNS1123Subdomain(value string) []string { … } const cIdentifierFmt … const identifierErrMsg … var cIdentifierRegexp … // IsCIdentifier tests for a string that conforms the definition of an identifier // in C. This checks the format, but not the length. func IsCIdentifier(value string) []string { … } // IsValidPortNum tests that the argument is a valid, non-zero port number. func IsValidPortNum(port int) []string { … } // IsInRange tests that the argument is in an inclusive range. func IsInRange(value int, min int, max int) []string { … } const minUserID … const maxUserID … const minGroupID … const maxGroupID … // IsValidGroupID tests that the argument is a valid Unix GID. func IsValidGroupID(gid int64) []string { … } // IsValidUserID tests that the argument is a valid Unix UID. func IsValidUserID(uid int64) []string { … } var portNameCharsetRegex … var portNameOneLetterRegexp … // IsValidPortName check that the argument is valid syntax. It must be // non-empty and no more than 15 characters long. It may contain only [-a-z0-9] // and must contain at least one letter [a-z]. It must not start or end with a // hyphen, nor contain adjacent hyphens. // // Note: We only allow lower-case characters, even though RFC 6335 is case // insensitive. func IsValidPortName(port string) []string { … } // IsValidIP tests that the argument is a valid IP address. func IsValidIP(value string) []string { … } // IsValidIPv4Address tests that the argument is a valid IPv4 address. func IsValidIPv4Address(fldPath *field.Path, value string) field.ErrorList { … } // IsValidIPv6Address tests that the argument is a valid IPv6 address. func IsValidIPv6Address(fldPath *field.Path, value string) field.ErrorList { … } const percentFmt … const percentErrMsg … var percentRegexp … // IsValidPercent checks that string is in the form of a percentage func IsValidPercent(percent string) []string { … } const httpHeaderNameFmt … const httpHeaderNameErrMsg … var httpHeaderNameRegexp … // IsHTTPHeaderName checks that a string conforms to the Go HTTP library's // definition of a valid header field name (a stricter subset than RFC7230). func IsHTTPHeaderName(value string) []string { … } const envVarNameFmt … const envVarNameFmtErrMsg … var envVarNameRegexp … // IsEnvVarName tests if a string is a valid environment variable name. func IsEnvVarName(value string) []string { … } const configMapKeyFmt … const configMapKeyErrMsg … var configMapKeyRegexp … // IsConfigMapKey tests for a string that is a valid key for a ConfigMap or Secret func IsConfigMapKey(value string) []string { … } // MaxLenError returns a string explanation of a "string too long" validation // failure. func MaxLenError(length int) string { … } // RegexError returns a string explanation of a regex validation failure. func RegexError(msg string, fmt string, examples ...string) string { … } // EmptyError returns a string explanation of a "must not be empty" validation // failure. func EmptyError() string { … } func prefixEach(msgs []string, prefix string) []string { … } // InclusiveRangeError returns a string explanation of a numeric "must be // between" validation failure. func InclusiveRangeError(lo, hi int) string { … } func hasChDirPrefix(value string) []string { … } // IsValidSocketAddr checks that string represents a valid socket address // as defined in RFC 789. (e.g 0.0.0.0:10254 or [::]:10254)) func IsValidSocketAddr(value string) []string { … }