validation

package
v0.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package validation contains useful validation functions

Index

Constants

View Source
const DNS1123UnderscoreLabelMaxLength int = validation.DNS1123LabelMaxLength

DNS1123UnderscoreLabelMaxLength is a label's max length in DNS (RFC 1123)

Variables

ValidateAnnotations to contain size and data format

Functions

func IsDNS1123UnderscoreLabel added in v0.2.0

func IsDNS1123UnderscoreLabel(value string) []string

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 IsGenericResourceName(value string) []string

func ReturnInvalidError

func ReturnInvalidError(gk schema.GroupKind, name string, errs field.ErrorList) error

ReturnInvalidError returns a Invalid error if the error list is not empty

func ValidateAddressable

func ValidateAddressable(addr duckv1.Addressable, optional bool, fld *field.Path) field.ErrorList

ValidateAddressable validates an addressable for non-optional addresses

func ValidateCommonObject

func ValidateCommonObject(obj metav1.Object) field.ErrorList

ValidateCommonObject common validations for objects in katanomi, includes, name, annotations etc.

func ValidateDuplicatedName

func ValidateDuplicatedName(fld *field.Path, name string, names sets.String) (errs field.ErrorList)

ValidateDuplicatedName makes sure there is only one name in the same set

func ValidateGenericResourceName added in v0.3.0

func ValidateGenericResourceName(name string, fld *field.Path) field.ErrorList

func ValidateIntegrationClassName

func ValidateIntegrationClassName(name string, fld *field.Path) field.ErrorList

ValidateIntegrationClassName validates class name TODO: should be moved to katanomi/pkg

func ValidateItemName

func ValidateItemName(name string, prefix bool, fld *field.Path) field.ErrorList

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

func ValidateItemNameUnderscore(name string, fld *field.Path) field.ErrorList

ValidateItemNameUnderscore validates a name of an item in a slice. this is used in resources, volumes and etc

func ValidateName

func ValidateName(obj metav1.Object, fld *field.Path) field.ErrorList

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

func ValidateRegExp(pattern string, fld *field.Path) field.ErrorList

ValidateRegExp validates that the string is a valid regular expression.

func ValidateResourceNameWithChinese added in v0.7.0

func ValidateResourceNameWithChinese(name string, fld *field.Path) field.ErrorList

func ValidateURL

func ValidateURL(uri *apis.URL, path *field.Path) field.ErrorList

ValidateURL validates if a specific URL is valid

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL