validation

package
v0.32.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2024 License: Apache-2.0 Imports: 8 Imported by: 823

Documentation

Index

Constants

View Source
const MaxSubresourceNameLength = 256
View Source
const UninitializedStatusUpdateErrorMsg string = `must not update status when the object is uninitialized`

Variables

View Source
var FieldManagerMaxLength = 128

Functions

func LabelSelectorHasInvalidLabelValue added in v0.26.0

func LabelSelectorHasInvalidLabelValue(ps *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 v0.19.0

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

func ValidateConditions added in v0.19.0

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

func ValidateCreateOptions

func ValidateCreateOptions(options *metav1.CreateOptions) field.ErrorList

func ValidateDeleteOptions

func ValidateDeleteOptions(options *metav1.DeleteOptions) field.ErrorList

func ValidateDryRun

func ValidateDryRun(fldPath *field.Path, dryRun []string) field.ErrorList

ValidateDryRun validates that a dryRun query param only contains allowed values.

func ValidateFieldManager

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

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

func ValidateFieldSelectorRequirement added in v0.31.0

func ValidateFieldSelectorRequirement(requirement metav1.FieldSelectorRequirement, opts FieldSelectorValidationOptions, fldPath *field.Path) field.ErrorList

ValidateLabelSelectorRequirement validates the requirement according to the opts and returns any validation errors.

func ValidateFieldValidation added in v0.23.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 *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 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.

func ValidateManagedFields added in v0.16.4

func ValidateManagedFields(fieldsList []metav1.ManagedFieldsEntry, fldPath *field.Path) field.ErrorList

func ValidatePatchOptions

func ValidatePatchOptions(options *metav1.PatchOptions, patchType types.PatchType) field.ErrorList

func ValidateTableOptions

func ValidateTableOptions(opts *metav1.TableOptions) field.ErrorList

ValidateTableOptions returns any invalid flags on TableOptions.

func ValidateUpdateOptions

func ValidateUpdateOptions(options *metav1.UpdateOptions) field.ErrorList

Types

type FieldSelectorValidationOptions added in v0.31.0

type FieldSelectorValidationOptions struct {
	// Allows an operator that is not interpretable to pass validation.  This is useful for cases where a broader check
	// can be performed, as in a *SubjectAccessReview
	AllowUnknownOperatorInRequirement bool
}

FieldSelectorValidationOptions is a struct that can be passed to ValidateFieldSelectorRequirement to record the validate options

type LabelSelectorValidationOptions added in v0.26.0

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

	// Allows an operator that is not interpretable to pass validation.  This is useful for cases where a broader check
	// can be performed, as in a *SubjectAccessReview
	AllowUnknownOperatorInRequirement 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