Documentation ¶
Overview ¶
Package validation contains useful validation functions
Index ¶
- Constants
- Variables
- func IsDNS1123UnderscoreLabel(value string) []string
- func IsGenericResourceName(value string) []string
- func ReturnInvalidError(gk schema.GroupKind, name string, errs field.ErrorList) error
- func ValidateAddressable(addr duckv1.Addressable, optional bool, fld *field.Path) field.ErrorList
- func ValidateCommonObject(obj metav1.Object) field.ErrorList
- func ValidateDuplicatedName(fld *field.Path, name string, names sets.String) (errs field.ErrorList)
- func ValidateGenericResourceName(name string, fld *field.Path) field.ErrorList
- func ValidateIntegrationClassName(name string, fld *field.Path) field.ErrorList
- func ValidateItemName(name string, prefix bool, fld *field.Path) field.ErrorList
- func ValidateItemNameUnderscore(name string, fld *field.Path) field.ErrorList
- func ValidateName(obj metav1.Object, fld *field.Path) field.ErrorList
- func ValidateObjectReference(objref *corev1.ObjectReference, optional, needsResourceType bool, ...) field.ErrorList
- func ValidateRegExp(pattern string, fld *field.Path) field.ErrorList
- func ValidateResourceNameWithChinese(name string, fld *field.Path) field.ErrorList
- func ValidateURL(uri *apis.URL, path *field.Path) field.ErrorList
Constants ¶
const DNS1123UnderscoreLabelMaxLength int = validation.DNS1123LabelMaxLength
DNS1123UnderscoreLabelMaxLength is a label's max length in DNS (RFC 1123)
Variables ¶
var ValidateAnnotations = apimachineryvalidation.ValidateAnnotations
ValidateAnnotations to contain size and data format
Functions ¶
func IsDNS1123UnderscoreLabel ¶ added in v0.2.0
IsDNS1123UnderscoreLabel tests for a string that conforms to the definition of a label in DNS (RFC 1123) but accepting underscores in the middle.
func IsGenericResourceName ¶ added in v0.3.0
func ReturnInvalidError ¶
ReturnInvalidError returns a Invalid error if the error list is not empty
func ValidateAddressable ¶
ValidateAddressable validates an addressable for non-optional addresses
func ValidateCommonObject ¶
ValidateCommonObject common validations for objects in katanomi, includes, name, annotations etc.
func ValidateDuplicatedName ¶
ValidateDuplicatedName makes sure there is only one name in the same set
func ValidateGenericResourceName ¶ added in v0.3.0
func ValidateIntegrationClassName ¶
ValidateIntegrationClassName validates class name TODO: should be moved to katanomi/pkg
func ValidateItemName ¶
ValidateItemName validates a name of an item in a slice. this is used in
Integration resources, volumes and etc
func ValidateItemNameUnderscore ¶ added in v0.2.0
ValidateItemNameUnderscore validates a name of an item in a slice. this is used in resources, volumes and etc
func ValidateName ¶
ValidateName standard name validation for all katanomi types uses the same validation of namespace objects
func ValidateObjectReference ¶
func ValidateObjectReference(objref *corev1.ObjectReference, optional, needsResourceType bool, fld *field.Path) field.ErrorList
ValidateObjectReference validates an object reference
func ValidateRegExp ¶ added in v0.7.0
ValidateRegExp validates that the string is a valid regular expression.
func ValidateResourceNameWithChinese ¶ added in v0.7.0
Types ¶
This section is empty.