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 ¶
- type EnqueueRequestForObject
- func (e *EnqueueRequestForObject) Create(evt cevent.CreateEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForObject) Delete(evt cevent.DeleteEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForObject) Generic(evt cevent.GenericEvent, q workqueue.RateLimitingInterface)
- func (e *EnqueueRequestForObject) Update(evt cevent.UpdateEvent, q workqueue.RateLimitingInterface)
- type EventHandler
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 ¶
func (e *EnqueueRequestForObject) Create(evt cevent.CreateEvent, q workqueue.RateLimitingInterface)
Create implements EventHandler.
func (*EnqueueRequestForObject) Delete ¶
func (e *EnqueueRequestForObject) Delete(evt cevent.DeleteEvent, q workqueue.RateLimitingInterface)
Delete implements EventHandler.
func (*EnqueueRequestForObject) Generic ¶
func (e *EnqueueRequestForObject) Generic(evt cevent.GenericEvent, q workqueue.RateLimitingInterface)
Generic implements EventHandler.
func (*EnqueueRequestForObject) Update ¶
func (e *EnqueueRequestForObject) Update(evt cevent.UpdateEvent, q workqueue.RateLimitingInterface)
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.