Documentation

Index

Constants

View Source
const (
	// TypeField is the special field indicate the type of the workloadDefinition
	TypeField = "type"
)

Variables

This section is empty.

Functions

func RegisterMutatingHandler

func RegisterMutatingHandler(mgr manager.Manager) error

RegisterMutatingHandler will register component mutation handler to the webhook

func RegisterValidatingHandler

func RegisterValidatingHandler(mgr manager.Manager)

RegisterValidatingHandler will regsiter component mutation handler to the webhook

func ValidateComponentObject

func ValidateComponentObject(obj *v1alpha2.Component) field.ErrorList

ValidateComponentObject validates the Component on creation

Types

type MutatingHandler

type MutatingHandler struct {
	Client client.Client
	Mapper discoverymapper.DiscoveryMapper

	// Decoder decodes objects
	Decoder *admission.Decoder
}

MutatingHandler handles Component

func (*MutatingHandler) Handle

Handle handles admission requests.

func (*MutatingHandler) InjectClient

func (h *MutatingHandler) InjectClient(c client.Client) error

InjectClient injects the client into the ComponentMutatingHandler

func (*MutatingHandler) InjectDecoder

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

InjectDecoder injects the decoder into the ComponentMutatingHandler

func (*MutatingHandler) Mutate

func (h *MutatingHandler) Mutate(obj *v1alpha2.Component) error

Mutate sets all the default value for the Component

type ValidatingHandler

type ValidatingHandler struct {

	// Decoder decodes objects
	Decoder *admission.Decoder
}

ValidatingHandler handles Component

func (*ValidatingHandler) Handle

Handle handles admission requests.

func (*ValidatingHandler) InjectDecoder

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

InjectDecoder injects the decoder into the ComponentValidatingHandler