@@ -95,6 +95,10 @@ func (ks *Kind) Start(handler handler.EventHandler, queue workqueue.RateLimiting
95
95
return nil
96
96
}
97
97
98
+ func (ks * Kind ) String () string {
99
+ return fmt .Sprintf ("kind source: %v" , ks .Type .GetObjectKind ().GroupVersionKind ().String ())
100
+ }
101
+
98
102
var _ inject.Cache = & Kind {}
99
103
100
104
// InjectCache is internal should be called only by the Controller. InjectCache is used to inject
@@ -132,6 +136,10 @@ type Channel struct {
132
136
destLock sync.Mutex
133
137
}
134
138
139
+ func (cs * Channel ) String () string {
140
+ return fmt .Sprintf ("channel source: %p" , cs )
141
+ }
142
+
135
143
var _ inject.Stoppable = & Channel {}
136
144
137
145
// InjectStopChannel is internal should be called only by the Controller.
@@ -240,18 +248,22 @@ var _ Source = &Informer{}
240
248
241
249
// Start is internal and should be called only by the Controller to register an EventHandler with the Informer
242
250
// to enqueue reconcile.Requests.
243
- func (ks * Informer ) Start (handler handler.EventHandler , queue workqueue.RateLimitingInterface ,
251
+ func (is * Informer ) Start (handler handler.EventHandler , queue workqueue.RateLimitingInterface ,
244
252
prct ... predicate.Predicate ) error {
245
253
246
254
// Informer should have been specified by the user.
247
- if ks .Informer == nil {
255
+ if is .Informer == nil {
248
256
return fmt .Errorf ("must specify Informer.Informer" )
249
257
}
250
258
251
- ks .Informer .AddEventHandler (internal.EventHandler {Queue : queue , EventHandler : handler , Predicates : prct })
259
+ is .Informer .AddEventHandler (internal.EventHandler {Queue : queue , EventHandler : handler , Predicates : prct })
252
260
return nil
253
261
}
254
262
263
+ func (is * Informer ) String () string {
264
+ return fmt .Sprintf ("informer source: %p" , is .Informer )
265
+ }
266
+
255
267
// Func is a function that implements Source
256
268
type Func func (handler.EventHandler , workqueue.RateLimitingInterface , ... predicate.Predicate ) error
257
269
@@ -260,3 +272,7 @@ func (f Func) Start(evt handler.EventHandler, queue workqueue.RateLimitingInterf
260
272
pr ... predicate.Predicate ) error {
261
273
return f (evt , queue , pr ... )
262
274
}
275
+
276
+ func (f Func ) String () string {
277
+ return fmt .Sprintf ("func source: %p" , f )
278
+ }
0 commit comments