validation

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateLabelName

func ValidateLabelName(labelName string, fldPath *field.Path) field.ErrorList

ValidateLabelName validates that the label name is correctly defined.

func ValidateLabelSelector

func ValidateLabelSelector(ps *slim_metav1.LabelSelector, opts LabelSelectorValidationOptions, fldPath *field.Path) field.ErrorList

ValidateLabelSelector validate the LabelSelector according to the opts and returns any validation errors. opts.AllowInvalidLabelValueInSelector is only expected to be set to true when required for backwards compatibility with existing invalid data.

func ValidateLabelSelectorRequirement

func ValidateLabelSelectorRequirement(sr slim_metav1.LabelSelectorRequirement, opts LabelSelectorValidationOptions, fldPath *field.Path) field.ErrorList

ValidateLabelSelectorRequirement validate the requirement according to the opts and returns any validation errors. opts.AllowInvalidLabelValueInSelector is only expected to be set to true when required for backwards compatibility with existing invalid data.

func ValidateLabels

func ValidateLabels(labels map[string]string, fldPath *field.Path) field.ErrorList

ValidateLabels validates that a set of labels are correctly defined.

Types

type LabelSelectorValidationOptions

type LabelSelectorValidationOptions struct {
	// Allow invalid label value in selector
	AllowInvalidLabelValueInSelector bool
}

LabelSelectorValidationOptions is a struct that can be passed to ValidateLabelSelector to record the validate options

Jump to

Keyboard shortcuts

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