webhook

package
v0.0.0-...-d526987 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder builds a Webhook.

func NewGenericWebhookManagedBy

func NewGenericWebhookManagedBy(mgr manager.Manager) *Builder

NewGenericWebhookManagedBy returns a new webhook builder that will be started by the provided Manager.

func (*Builder) Complete

func (blder *Builder) Complete(i interface{}) error

Complete builds the webhook. If the given object implements the Mutator interface, a MutatingWebhook will be created. If the given object implements the Validator interface, a ValidatingWebhook will be created.

func (*Builder) For

func (blder *Builder) For(apiType runtime.Object) *Builder

For takes a runtime.Object which should be a CR.

type MutatingWebhook

type MutatingWebhook struct {
	Client  client.Client
	Decoder *admission.Decoder
}

MutatingWebhook is a generic mutating admission webhook.

func (*MutatingWebhook) InjectClient

func (v *MutatingWebhook) InjectClient(client client.Client) error

InjectClient implements the inject.Client interface.

func (*MutatingWebhook) InjectDecoder

func (v *MutatingWebhook) InjectDecoder(decoder *admission.Decoder) error

InjectDecoder implements the admission.DecoderInjector interface.

func (*MutatingWebhook) Mutate

Mutate implements the Mutator interface.

type Mutator

type Mutator interface {
	// Mutate yields a response to an mutating AdmissionRequest.
	Mutate(context.Context, admission.Request) admission.Response
}

Mutator specifies the interface for a mutating webhook.

type ValidatingWebhook

type ValidatingWebhook struct {
	Client  client.Client
	Decoder *admission.Decoder
}

ValidatingWebhook is a generic validating admission webhook.

func (*ValidatingWebhook) InjectClient

func (v *ValidatingWebhook) InjectClient(client client.Client) error

InjectClient implements the inject.Client interface.

func (*ValidatingWebhook) InjectDecoder

func (v *ValidatingWebhook) InjectDecoder(decoder *admission.Decoder) error

InjectDecoder implements the admission.DecoderInjector interface.

func (*ValidatingWebhook) Validate

Validate implements the Validator interface.

type Validator

type Validator interface {
	// Validate yields a response to an validating AdmissionRequest.
	Validate(context.Context, admission.Request) admission.Response
}

Validator specifies the interface for a validating webhook.

Jump to

Keyboard shortcuts

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