@@ -34,10 +34,10 @@ import (
34
34
// For example, a controller impl that wants to be notified of updates to Runs
35
35
// which reference a Task with apiVersion "example.dev/v0" and kind "Example":
36
36
//
37
- // runinformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
38
- // FilterFunc: FilterRunRef("example.dev/v0", "Example"),
39
- // Handler: controller.HandleAll(impl.Enqueue),
40
- // })
37
+ // runinformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
38
+ // FilterFunc: FilterRunRef("example.dev/v0", "Example"),
39
+ // Handler: controller.HandleAll(impl.Enqueue),
40
+ // })
41
41
func FilterRunRef (apiVersion , kind string ) func (interface {}) bool {
42
42
return func (obj interface {}) bool {
43
43
r , ok := obj .(* v1alpha1.Run )
@@ -67,10 +67,10 @@ func FilterRunRef(apiVersion, kind string) func(interface{}) bool {
67
67
// For example, a controller impl that wants to be notified of updates to TaskRuns that are controlled by
68
68
// a Run which references a custom task with apiVersion "example.dev/v0" and kind "Example":
69
69
//
70
- // taskruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
71
- // FilterFunc: FilterOwnerRunRef("example.dev/v0", "Example"),
72
- // Handler: controller.HandleAll(impl.Enqueue),
73
- // })
70
+ // taskruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
71
+ // FilterFunc: FilterOwnerRunRef("example.dev/v0", "Example"),
72
+ // Handler: controller.HandleAll(impl.Enqueue),
73
+ // })
74
74
func FilterOwnerRunRef (runLister listersalpha.RunLister , apiVersion , kind string ) func (interface {}) bool {
75
75
return func (obj interface {}) bool {
76
76
object , ok := obj .(metav1.Object )
@@ -114,10 +114,10 @@ func FilterOwnerRunRef(runLister listersalpha.RunLister, apiVersion, kind string
114
114
// For example, a controller impl that wants to be notified of updates to CustomRuns
115
115
// which reference a Task with apiVersion "example.dev/v0" and kind "Example":
116
116
//
117
- // customruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
118
- // FilterFunc: FilterCustomRunRef("example.dev/v0", "Example"),
119
- // Handler: controller.HandleAll(impl.Enqueue),
120
- // })
117
+ // customruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
118
+ // FilterFunc: FilterCustomRunRef("example.dev/v0", "Example"),
119
+ // Handler: controller.HandleAll(impl.Enqueue),
120
+ // })
121
121
func FilterCustomRunRef (apiVersion , kind string ) func (interface {}) bool {
122
122
return func (obj interface {}) bool {
123
123
r , ok := obj .(* v1beta1.CustomRun )
@@ -147,10 +147,10 @@ func FilterCustomRunRef(apiVersion, kind string) func(interface{}) bool {
147
147
// For example, a controller impl that wants to be notified of updates to TaskRuns that are controlled by
148
148
// a CustomRun which references a custom task with apiVersion "example.dev/v0" and kind "Example":
149
149
//
150
- // taskruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
151
- // FilterFunc: FilterOwnerCustomRunRef("example.dev/v0", "Example"),
152
- // Handler: controller.HandleAll(impl.Enqueue),
153
- // })
150
+ // taskruninformer.Get(ctx).Informer().AddEventHandler(cache.FilteringResourceEventHandler{
151
+ // FilterFunc: FilterOwnerCustomRunRef("example.dev/v0", "Example"),
152
+ // Handler: controller.HandleAll(impl.Enqueue),
153
+ // })
154
154
func FilterOwnerCustomRunRef (customRunLister listersbeta.CustomRunLister , apiVersion , kind string ) func (interface {}) bool {
155
155
return func (obj interface {}) bool {
156
156
object , ok := obj .(metav1.Object )
0 commit comments