crddeletionprotection

package
v1.63.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 License: Apache-2.0, BSD-2-Clause, MIT, + 1 more Imports: 20 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
	// contains filtered or unexported fields
}

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.

func (*Handler) InjectDecoder

func (h *Handler) InjectDecoder(d *admission.Decoder) error

InjectDecoder injects the decoder.

Jump to

Keyboard shortcuts

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