File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -175,7 +175,7 @@ func (c *Controller[request]) Start(ctx context.Context) error {
175
175
// caches.
176
176
errGroup := & errgroup.Group {}
177
177
for _ , watch := range c .startWatches {
178
- log := c .LogConstructor (nil ).WithValues ("source" , fmt . Sprintf ( "%s" , watch ))
178
+ log := c .LogConstructor (nil ).WithValues ("source" , watch . String ( ))
179
179
didStartSyncingSource := & atomic.Bool {}
180
180
errGroup .Go (func () error {
181
181
// Use a timeout for starting and syncing the source to avoid silently
Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ type TypedSource[request comparable] interface {
56
56
// Start is internal and should be called only by the Controller to start the source.
57
57
// Start must be non-blocking.
58
58
Start (context.Context , workqueue.TypedRateLimitingInterface [request ]) error
59
+
60
+ // String enforces the custom source to adhere to the fmt.Stringer interface
61
+ // to print when being logged.
62
+ String () string
59
63
}
60
64
61
65
// SyncingSource is a source that needs syncing prior to being usable. The controller
You can’t perform that action at this time.
0 commit comments