handler

package
v1.6.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package handler defines EventHandlers that enqueue reconcile.Requests in response to Create, Update, Deletion Events observed from Watching Kubernetes APIs.

The implementation is derived from sigs.k8s.io/controller-runtime/pkg/handler and the main difference are: - event handlers are resourceGroup aware. - the package provide only one event handler implementation, EnqueueRequestForObject.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnqueueRequestForObject

type EnqueueRequestForObject struct{}

EnqueueRequestForObject enqueues a Request containing the ResourceGroup, Name and Namespace of the object that is the source of the Event. handler.EnqueueRequestForObject is used by almost all Controllers that have associated Resources to reconcile.

func (*EnqueueRequestForObject) Create

Create implements EventHandler.

func (*EnqueueRequestForObject) Delete

Delete implements EventHandler.

func (*EnqueueRequestForObject) Generic

Generic implements EventHandler.

func (*EnqueueRequestForObject) Update

Update implements EventHandler.

type EventHandler

type EventHandler interface {
	// Create is called in response to an create event - e.g. VM Creation.
	Create(cevent.CreateEvent, workqueue.RateLimitingInterface)

	// Update is called in response to an update event -  e.g. VM Updated.
	Update(cevent.UpdateEvent, workqueue.RateLimitingInterface)

	// Delete is called in response to a delete event - e.g. VM Deleted.
	Delete(cevent.DeleteEvent, workqueue.RateLimitingInterface)

	// Generic is called in response to an event of an unknown type or a synthetic event triggered as a cron or
	// external trigger request - e.g. reconcile re-sync.
	Generic(cevent.GenericEvent, workqueue.RateLimitingInterface)
}

EventHandler enqueues reconcile.Requests in response to events (e.g. object Create). EventHandlers map an Event for one object to trigger Reconciles for either the same object or different objects - e.g. if there is an Event for object with type Foo then reconcile one or more object(s) with type Bar.

Jump to

Keyboard shortcuts

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