Documentation ¶
Index ¶
- type ForObservePredicate
- type ObservedEventHandler
- func (h *ObservedEventHandler) Create(ctx context.Context, evt event.CreateEvent, ...)
- func (h *ObservedEventHandler) Delete(ctx context.Context, evt event.DeleteEvent, ...)
- func (h *ObservedEventHandler) Generic(ctx context.Context, evt event.GenericEvent, ...)
- func (h *ObservedEventHandler) Update(ctx context.Context, evt event.UpdateEvent, ...)
- type TriggerType
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 (p *ForObservePredicate) Create(e event.CreateEvent) bool
func (*ForObservePredicate) Delete ¶
func (p *ForObservePredicate) Delete(e event.DeleteEvent) bool
func (*ForObservePredicate) Generic ¶
func (p *ForObservePredicate) Generic(e event.GenericEvent) bool
func (*ForObservePredicate) Update ¶
func (p *ForObservePredicate) Update(e event.UpdateEvent) bool
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
func (*ObservedEventHandler) Create ¶
func (h *ObservedEventHandler) Create(ctx context.Context, evt event.CreateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request])
func (*ObservedEventHandler) Delete ¶
func (h *ObservedEventHandler) Delete(ctx context.Context, evt event.DeleteEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request])
func (*ObservedEventHandler) Generic ¶
func (h *ObservedEventHandler) Generic(ctx context.Context, evt event.GenericEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request])
func (*ObservedEventHandler) Update ¶
func (h *ObservedEventHandler) Update(ctx context.Context, evt event.UpdateEvent, q workqueue.TypedRateLimitingInterface[reconcile.Request])
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