Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnqueueRequestsFrom ¶
func EnqueueRequestsFrom(m Mapper, updateBehavior UpdateBehavior, log logr.Logger) handler.EventHandler
EnqueueRequestsFrom is similar to controller-runtime's mapper.EnqueueRequestsFromMapFunc. Instead of taking only a MapFunc it also allows passing a Mapper interface. Also, it allows customizing the behavior on UpdateEvents. For UpdateEvents, the given UpdateBehavior decides if only the old, only the new or both objects should be mapped and enqueued.
func ObjectListToRequests ¶ added in v1.52.0
func ObjectListToRequests(list client.ObjectList, predicates ...func(client.Object) bool) []reconcile.Request
ObjectListToRequests adds a reconcile.Request for each object in the provided list.
Types ¶
type MapFunc ¶
type MapFunc func(ctx context.Context, log logr.Logger, reader client.Reader, obj client.Object) []reconcile.Request
MapFunc is the signature required for enqueueing requests from a generic function. This type is usually used with EnqueueRequestsFromMapFunc when registering an event mapper.
type Mapper ¶
type Mapper interface { // Map maps an object Map(ctx context.Context, log logr.Logger, reader client.Reader, obj client.Object) []reconcile.Request }
Mapper maps an object to a collection of keys to be enqueued
func ClusterToObjectMapper ¶
func ClusterToObjectMapper(newObjListFunc func() client.ObjectList, predicates []predicate.Predicate) Mapper
ClusterToObjectMapper returns a mapper that returns requests for objects whose referenced clusters have been modified.
type UpdateBehavior ¶
type UpdateBehavior uint8
UpdateBehavior determines how an update should be handled.
const ( // UpdateWithOldAndNew considers both, the old as well as the new object, in case of an update. UpdateWithOldAndNew UpdateBehavior = iota // UpdateWithOld considers only the old object in case of an update. UpdateWithOld // UpdateWithNew considers only the new object in case of an update. UpdateWithNew )