genericvalidator

package
v1.134.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT Imports: 6 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdmissionValidator

type AdmissionValidator[TObj runtime.Object] struct {
	CreateValidation Validator[TObj]
	UpdateValidation Validator[TObj]
	DeleteValidation Validator[TObj]
}

func NewGenericAdmissionValidator

func NewGenericAdmissionValidator[TObj runtime.Object](createValidator Validator[TObj], updateValidator Validator[TObj], deleteValidator Validator[TObj]) *AdmissionValidator[TObj]

func (*AdmissionValidator[TObj]) Register

func (v *AdmissionValidator[TObj]) Register(mgr manager.Manager, path string)

func (*AdmissionValidator[TObj]) ValidateCreate

func (v *AdmissionValidator[TObj]) ValidateCreate(ctx context.Context, obj TObj) (warnings admission.Warnings, err error)

func (*AdmissionValidator[TObj]) ValidateDelete

func (v *AdmissionValidator[TObj]) ValidateDelete(ctx context.Context, obj TObj) (warnings admission.Warnings, err error)

func (*AdmissionValidator[TObj]) ValidateUpdate

func (v *AdmissionValidator[TObj]) ValidateUpdate(ctx context.Context, oldObj, newObj TObj) (warnings admission.Warnings, err error)

type Validator

type Validator[TObj runtime.Object] interface {
	Validate(ctx context.Context, obj TObj) (warnings admission.Warnings, err error)
}

type ValidatorFunc

type ValidatorFunc[TObj runtime.Object] func(ctx context.Context, obj TObj) (warnings admission.Warnings, err error)

ValidatorFunc is a function type that implements the Validator interface. It can be used to create inline validators without needing to define a separate struct.

func (ValidatorFunc[TObj]) Validate

func (f ValidatorFunc[TObj]) Validate(ctx context.Context, obj TObj) (warnings admission.Warnings, err error)

Jump to

Keyboard shortcuts

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