builder

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdmitMesgUpdateOnDeleting = "Update is allowed during deletion in order to remove the finalizers."
)

Variables

This section is empty.

Functions

func IsPrivilegedAccount added in v1.8.5

func IsPrivilegedAccount(
	ctx *context.WebhookContext, userInfo authv1.UserInfo) bool

Types

type MutatingWebhook

type MutatingWebhook struct {
	admission.Webhook

	// Name is the name of the webhook.
	Name string

	// Path is the path of the webhook.
	Path string
}

MutatingWebhook is an admissions webhook that mutates VM Operator resources.

func NewMutatingWebhook

func NewMutatingWebhook(
	ctx *context.ControllerManagerContext,
	mgr ctrlmgr.Manager,
	webhookName string,
	mutator Mutator) (*MutatingWebhook, error)

NewMutatingWebhook returns a new admissions webhook for mutating requests.

type Mutator

type Mutator interface {
	// For returns the GroupVersionKind for which this webhook mutates requests.
	For() schema.GroupVersionKind

	// Mutate will try modify invalid value.
	Mutate(*context.WebhookRequestContext) admission.Response
}

Mutator is used to create a new admissions webhook for mutating requests.

type MutatorFunc

type MutatorFunc func(client.Client) Mutator

type ValidatingWebhook

type ValidatingWebhook struct {
	admission.Webhook

	// Name is the name of the webhook.
	Name string

	// Path is the path of the webhook.
	Path string
}

ValidatingWebhook is an admissions webhook that validates resources.

func NewValidatingWebhook

func NewValidatingWebhook(
	ctx *context.ControllerManagerContext,
	mgr ctrlmgr.Manager,
	webhookName string,
	validator Validator) (*ValidatingWebhook, error)

NewValidatingWebhook returns a new admissions webhook for validating requests.

type Validator

type Validator interface {
	// For returns the GroupVersionKind for which this webhook validates requests.
	For() schema.GroupVersionKind

	// ValidateCreate returns nil if the request is valid.
	ValidateCreate(*context.WebhookRequestContext) admission.Response

	// ValidateDelete returns nil if the request is valid.
	ValidateDelete(*context.WebhookRequestContext) admission.Response

	// ValidateUpdate returns nil if the request is valid.
	ValidateUpdate(*context.WebhookRequestContext) admission.Response
}

Validator is used to create a new admissions webhook for validating requests.

type ValidatorFunc

type ValidatorFunc func(client client.Client) Validator

Jump to

Keyboard shortcuts

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