handler

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ForObservePredicate

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

ForObservePredicate is a predicate that observes details about event triggers of type `EnqueueRequestForObject`, i.e. events on the object being reconciled itself. NOTE: this is the only way to wrap the event handler for a controller-runtime controller's primary reconciled GVK invoked via `builder.For`.

func NewForObservePredicate

func NewForObservePredicate(
	log *zap.SugaredLogger,
	scheme *runtime.Scheme,
	controllerName string,
	metrics *metrics.Metrics,
) *ForObservePredicate

NewForObservePredicate returns a new ForObservePredicate that uses the supplied logger to debug log details about the event trigger.

func (*ForObservePredicate) Create

func (*ForObservePredicate) Delete

func (*ForObservePredicate) Generic

func (*ForObservePredicate) Update

type ObservedEventHandler

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

ObservedEventHandler wraps the underlying controller-runtime implementation with logging and metrics.

func NewObservedEventHandler

func NewObservedEventHandler(
	log *zap.SugaredLogger,
	scheme *runtime.Scheme,
	controllerName string,
	metrics *metrics.Metrics,
	origHandler handler.EventHandler,
	triggerType TriggerType,
) *ObservedEventHandler

NewObservedEventHandler creates an ObservedEventHandler Due to controller runtime upstream changes, we must pass the triggerType in directly. For enqueueRequestForOwner, use TriggerTypeChild For EnqueueRequestForObject, use TriggerTypeSelf For enqueueRequestsFromMapFunc, use TriggerTypeRelative

type TriggerType

type TriggerType string

TriggerType is the type of event trigger that actuates a reconciler

const (
	// TriggerTypeSelf are triggers caused by events on the reconciled object itself
	TriggerTypeSelf TriggerType = "self"

	// TriggerTypeChild are triggers caused by events on objects who have an owner reference to the reconciled object
	TriggerTypeChild TriggerType = "child"

	// TriggerTypeRelative are triggers caused by events on related objects, whose relation is explicitly defined by the programmer.
	TriggerTypeRelative TriggerType = "relative" // TODO Does the family analogy work here? If not, find a better name

)

func (TriggerType) String

func (t TriggerType) String() string

Jump to

Keyboard shortcuts

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