crddeletionprotection

package
v1.106.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// HandlerName is the name of this webhook handler.
	HandlerName = "crd-deletion-protection"
	// WebhookPath is the HTTP handler path for this webhook handler.
	WebhookPath = "/webhooks/validate-crd-deletion"
)

Variables

View Source
var ObjectSelector = map[string]string{gardenerutils.DeletionProtected: "true"}

ObjectSelector is the object selector for CustomResourceDefinitions used by this admission controller.

Functions

func ExtractRequestObject

func ExtractRequestObject(ctx context.Context, reader client.Reader, decoder admission.Decoder, request admission.Request, listOp client.ListOption) (runtime.Object, error)

ExtractRequestObject extracts the object in the admission request and returns it. The given `ListOption` is used to list affected objects in case of a `DELETECOLLECTION` request.

Types

type Handler

type Handler struct {
	Logger       logr.Logger
	SourceReader client.Reader
	Decoder      admission.Decoder
}

Handler validating DELETE requests for extension CRDs and extension resources, that are marked for deletion protection (`gardener.cloud/deletion-protected`).

func (*Handler) AddToManager

func (h *Handler) AddToManager(mgr manager.Manager) error

AddToManager adds Handler to the given manager.

func (*Handler) Handle

func (h *Handler) Handle(ctx context.Context, request admission.Request) admission.Response

Handle validates the DELETE request.

Jump to

Keyboard shortcuts

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