validate

package
v0.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Default error message for invalid label/annotation keys
	ErrNSNotAllowed = fmt.Errorf("namespace is not allowed")
	// Default error message for invalid label/annotation keys
	ErrUnprefixedKeysNotAllowed = fmt.Errorf("unprefixed keys are not allowed")
	// Default error for invalid taint effect
	ErrInvalidTaintEffect = fmt.Errorf("invalid taint effect")
	// Default error for empty taint effect
	ErrEmptyTaintEffect = fmt.Errorf("empty taint effect")
)

Functions

func Annotation

func Annotation(key, value string) error

Annotation validates an annotation key and value and returns an error if the key or value is invalid.

func Annotations

func Annotations(annotations map[string]string) []error

Annotations validates a map of annotations and returns a slice of errors if any of the annotations are invalid.

func ExtendedResource

func ExtendedResource(key, value string) error

ExtendedResource validates an extended resource key and value and returns an error if the key or value is invalid.

func ExtendedResources

func ExtendedResources(extendedResources map[string]string) []error

ExtendedResources validates a map of extended resources and returns a slice of errors if any of the extended resources are invalid.

func Label

func Label(key, value string) error

Label validates a label key and value and returns an error if the key or value is invalid.

func Labels

func Labels(labels map[string]string) []error

Labels validates a map of labels and returns a slice of errors if any of the labels are invalid.

func MatchAny

func MatchAny(matchAny []nfdv1alpha1.MatchAnyElem) []error

MatchAny validates a slice of MatchAnyElem and returns a slice of errors if any of the MatchAnyElem are invalid.

func MatchFeatures

func MatchFeatures(matchFeature nfdv1alpha1.FeatureMatcher) []error

MatchFeatures validates a slice of FeatureMatcher and returns a slice of errors if any of the FeatureMatcher are invalid.

func Taint

func Taint(taint *corev1.Taint) error

Taint validates a taint key and value and returns an error if the key or value is invalid.

func Taints

func Taints(taints []corev1.Taint) []error

Taints validates a slice of taints and returns a slice of errors if any of the taints are invalid.

func Template

func Template(labelsTemplate string) []error

Template validates a template string and returns a slice of errors if the template is invalid.

Types

This section is empty.

Jump to

Keyboard shortcuts

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