component

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

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, args controller.Args)

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(ctx context.Context, 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

Jump to

Keyboard shortcuts

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