webhooks

package
v0.0.310 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterDefaulter

func RegisterDefaulter(name string, d *DefaulterWrap)

func RegisterValidator

func RegisterValidator(name string, v *ValidatorWrap)

func UnRegisterDefaulter

func UnRegisterDefaulter(name string)

func UnRegisterValidator

func UnRegisterValidator(name string)

Types

type Defaulter

type Defaulter interface {
	Default(obj runtime.Object) error
}

Defaulter defines functions for setting defaults on resources

type DefaulterWrap

type DefaulterWrap struct {
	Obj    runtime.Object
	Helper Defaulter
}

func GetDefaulter

func GetDefaulter(name string) *DefaulterWrap

type MutatingHandler

type MutatingHandler struct {
	C client.Client
	// contains filtered or unexported fields
}

func (*MutatingHandler) Handle

Handle handles admission requests.

func (*MutatingHandler) InjectDecoder

func (h *MutatingHandler) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder into a MutatingHandler.

type ValidatingHandler

type ValidatingHandler struct {
	C client.Client
	// contains filtered or unexported fields
}

func (*ValidatingHandler) Handle

Handle handles admission requests.

func (*ValidatingHandler) InjectDecoder

func (h *ValidatingHandler) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder into a ValidatingHandler.

type Validator

type Validator interface {
	ValidateCreate(obj runtime.Object) error
	ValidateUpdate(old runtime.Object, new runtime.Object) error
	ValidateDelete(obj runtime.Object) error
}

Validator defines functions for validating an operation

type ValidatorWrap

type ValidatorWrap struct {
	Obj    runtime.Object
	Helper Validator
}

func GetValidator

func GetValidator(name string) *ValidatorWrap

Jump to

Keyboard shortcuts

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