usage

package
v1.15.2 Latest Latest
Warning

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

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

Documentation

Overview

Package usage contains the Handler for the usage webhook.

Index

Constants

View Source
const (
	// InUseIndexKey used to index CRDs by "Kind" and "group", to be used when
	// indexing and retrieving needed CRDs
	InUseIndexKey = "inuse.apiversion.kind.name"

	// AnnotationKeyDeletionAttempt is the annotation key used to record whether
	// a deletion attempt was made and blocked by the Usage. The value stored is
	// the propagation policy used with the deletion attempt.
	AnnotationKeyDeletionAttempt = "usage.crossplane.io/deletion-attempt-with-policy"
)

Variables

This section is empty.

Functions

func IndexValueForObject

func IndexValueForObject(u *unstructured.Unstructured) string

IndexValueForObject returns the index value for the given object.

func SetupWebhookWithManager

func SetupWebhookWithManager(mgr ctrl.Manager, options controller.Options) error

SetupWebhookWithManager sets up the webhook with the manager.

Types

type Handler

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

Handler implements the admission Handler for Composition.

func NewHandler

func NewHandler(client client.Client, opts ...HandlerOption) *Handler

NewHandler returns a new Handler.

func (*Handler) Handle

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

Handle handles the admission request, validating there is no usage for the resource being deleted.

type HandlerOption

type HandlerOption func(*Handler)

HandlerOption is used to configure the Handler.

func WithLogger

func WithLogger(l logging.Logger) HandlerOption

WithLogger configures the logger for the Handler.

Jump to

Keyboard shortcuts

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