Documentation ¶
Overview ¶
Package controller provides helper methods for external controllers for Custom Task types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterOwnerRunRef ¶ added in v0.17.0
func FilterOwnerRunRef(runLister listersalpha.RunLister, apiVersion, kind string) func(interface{}) bool
FilterOwnerRunRef returns a filter that can be passed to an Informer for any runtime object, which filters out objects that aren't controlled by a Run that references a particular apiVersion and kind.
For example, a controller impl that wants to be notified of updates to TaskRuns that are controlled by a Run which references a custom task with apiVersion "example.dev/v0" and kind "Example":
taskruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{ FilterFunc: FilterOwnerRunRef("example.dev/v0", "Example"), Handler: controller.HandleAll(impl.Enqueue), })
func FilterRunRef ¶
FilterRunRef returns a filter that can be passed to a Run Informer, which filters out Runs for apiVersion and kinds that a controller doesn't care about.
For example, a controller impl that wants to be notified of updates to Runs which reference a Task with apiVersion "example.dev/v0" and kind "Example":
runinformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{ FilterFunc: FilterRunRef("example.dev/v0", "Example"), Handler: controller.HandleAll(impl.Enqueue), })
Types ¶
This section is empty.