admission

package
v1.15.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeRawUnstructured added in v1.15.0

func DecodeRawUnstructured(rawObj runtime.RawExtension, rawKind schema.GroupVersionKind) (*unstructured.Unstructured, error)

DecodeRawUnstructured decodes a RawExtension object into an unstructured object.

func NewCustomMutationWebhook added in v1.15.0

func NewCustomMutationWebhook(
	mutationWebhook MutationInterface,
) *admission.Webhook

func NewCustomValidationWebhook added in v1.15.0

func NewCustomValidationWebhook(
	scheme *runtime.Scheme,
	validationWebhook ValidationInterface,
) *admission.Webhook

Types

type Handler

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

func NewHandler

func NewHandler(ops ...admissionv1.Operation) *Handler

func (Handler) Handles

func (h Handler) Handles(operation admissionv1.Operation) bool

type Interface

type Interface interface {
	Handles(admissionv1.Operation) bool
}

Interface is the base admission interface

type MutationInterface

type MutationInterface interface {
	Interface

	Mutate(ctx context.Context, request admissionv1.AdmissionRequest, obj *unstructured.Unstructured) (err error)
}

MutationInterface defines an admission handler that validates requests. It may not perform any kind of mutation.

type PluginChain

type PluginChain []Interface

func (PluginChain) Handles

func (pc PluginChain) Handles(operation admissionv1.Operation) bool

func (PluginChain) Mutate

func (PluginChain) Validate

func (pc PluginChain) Validate(ctx context.Context, request admissionv1.AdmissionRequest, oldObj, obj runtime.Object) ([]string, error)

type ValidationInterface

type ValidationInterface interface {
	Interface

	Validate(ctx context.Context, request admissionv1.AdmissionRequest, oldObj, obj runtime.Object) (warnings []string, err error)
}

ValidationInterface defines an admission handler that validates requests. It may not perform any kind of mutation.

Jump to

Keyboard shortcuts

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