validation

package
v1.16.0-pre.2 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

View Source
const MaxSubresourceNameLength = 256

Variables

View Source
var FieldManagerMaxLength = 128

Functions

func LabelSelectorHasInvalidLabelValue added in v1.16.0

func LabelSelectorHasInvalidLabelValue(ps *slim_metav1.LabelSelector) bool

LabelSelectorHasInvalidLabelValue returns true if the given selector contains an invalid label value in a match expression. This is useful for determining whether AllowInvalidLabelValueInSelector should be set to true when validating an update based on existing persisted invalid values.

func ValidateCondition added in v1.16.0

func ValidateCondition(condition slim_metav1.Condition, fldPath *field.Path) field.ErrorList

func ValidateConditions added in v1.16.0

func ValidateConditions(conditions []slim_metav1.Condition, fldPath *field.Path) field.ErrorList

func ValidateFieldManager added in v1.16.0

func ValidateFieldManager(fieldManager string, fldPath *field.Path) field.ErrorList

ValidateFieldManager valides that the fieldManager is the proper length and only has printable characters.

func ValidateFieldValidation added in v1.16.0

func ValidateFieldValidation(fldPath *field.Path, fieldValidation string) field.ErrorList

ValidateFieldValidation validates that a fieldValidation query param only contains allowed values.

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