Documentation ¶
Overview ¶
Package webhook contains utilities for building Kubernetes webhooks.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mutator ¶
type Mutator struct {
MutationChain []MutateFn
}
Mutator satisfies CustomDefaulter interface with an ordered MutateFn list.
func NewMutator ¶
func NewMutator(opts ...MutatorOption) *Mutator
NewMutator returns a new instance of Mutator that can be used as CustomDefaulter.
type MutatorOption ¶
type MutatorOption func(*Mutator)
MutatorOption configures given Mutator.
func WithMutationFns ¶
func WithMutationFns(fns ...MutateFn) MutatorOption
WithMutationFns allows you to initiate the mutator with given list of mutator functions.
type ValidateCreateFn ¶
ValidateCreateFn is function type for creation validation.
type ValidateDeleteFn ¶
ValidateDeleteFn is function type for deletion validation.
type ValidateUpdateFn ¶
ValidateUpdateFn is function type for update validation.
type Validator ¶
type Validator struct { CreationChain []ValidateCreateFn UpdateChain []ValidateUpdateFn DeletionChain []ValidateDeleteFn }
Validator runs the given validation chains in order.
func NewValidator ¶
func NewValidator(opts ...ValidatorOption) *Validator
NewValidator returns a new Validator with no-op defaults.
func (*Validator) ValidateCreate ¶
ValidateCreate runs functions in creation chain in order.
func (*Validator) ValidateDelete ¶
ValidateDelete runs functions in deletion chain in order.
type ValidatorOption ¶
type ValidatorOption func(*Validator)
ValidatorOption allows you to configure given Validator.
func WithValidateCreationFns ¶
func WithValidateCreationFns(fns ...ValidateCreateFn) ValidatorOption
WithValidateCreationFns initializes the Validator with given set of creation validation functions.
func WithValidateDeletionFns ¶
func WithValidateDeletionFns(fns ...ValidateDeleteFn) ValidatorOption
WithValidateDeletionFns initializes the Validator with given set of deletion validation functions.
func WithValidateUpdateFns ¶
func WithValidateUpdateFns(fns ...ValidateUpdateFn) ValidatorOption
WithValidateUpdateFns initializes the Validator with given set of update validation functions.