@@ -74,31 +74,31 @@ func NewInstrumentedListerWatcher(lw cache.ListerWatcher, metrics *ListWatchMetr
74
74
75
75
// List is a wrapper func around the cache.ListerWatcher.List func. It increases the success/error
76
76
// / counters based on the outcome of the List operation it instruments.
77
- func (i * InstrumentedListerWatcher ) List (options metav1.ListOptions ) (res runtime.Object , err error ) {
77
+ func (i * InstrumentedListerWatcher ) List (options metav1.ListOptions ) (runtime.Object , error ) {
78
78
79
79
if i .useAPIServerCache {
80
80
options .ResourceVersion = "0"
81
81
}
82
82
83
- res , err = i .lw .List (options )
83
+ res , err : = i .lw .List (options )
84
84
if err != nil {
85
85
i .metrics .ListTotal .WithLabelValues ("error" , i .resource ).Inc ()
86
- return
86
+ return nil , err
87
87
}
88
88
89
89
i .metrics .ListTotal .WithLabelValues ("success" , i .resource ).Inc ()
90
- return
90
+ return res , nil
91
91
}
92
92
93
93
// Watch is a wrapper func around the cache.ListerWatcher.Watch func. It increases the success/error
94
94
// counters based on the outcome of the Watch operation it instruments.
95
- func (i * InstrumentedListerWatcher ) Watch (options metav1.ListOptions ) (res watch.Interface , err error ) {
96
- res , err = i .lw .Watch (options )
95
+ func (i * InstrumentedListerWatcher ) Watch (options metav1.ListOptions ) (watch.Interface , error ) {
96
+ res , err : = i .lw .Watch (options )
97
97
if err != nil {
98
98
i .metrics .WatchTotal .WithLabelValues ("error" , i .resource ).Inc ()
99
- return
99
+ return nil , err
100
100
}
101
101
102
102
i .metrics .WatchTotal .WithLabelValues ("success" , i .resource ).Inc ()
103
- return
103
+ return res , nil
104
104
}
0 commit comments