Slide 30
Slide 30 text
Filter Reconciliation Target
Controller
Watcher
Evt EvtEvt Source Event
Handler
Obj
Evt
Scalability
Watcher
Obj
Evt
…
ctrl.NewControllerManagedBy(mgr).
# Set Default Watcher for Reconcile Resource
For(&event.CNDT{}).
# Set Default Watcher for Own Resource
Owns(&event.Session{}).
# Set Custom Watcher
Watches(
&source.Channel{Source: events},
&handler.EnqueueRequestsFromMapFunc{
ToRequests: handler.ToRequestsFunc(
func{a handler.MapObject} []reconcile.Request {
if a.Meta.GetLabels()["year"] != "2019" {
return nil
}
return []reconcile.Request{
{
Name: a.Meta.GetLabels()[“cndt”],
Namespace: a.Meta.GetNamespace(),
},
},
}),
},
&predicate.Funcs{
Predicate Req
Evt
Source Event
Handler
Predicate
Evt Req
For( )
Owns( )