Skip to content

Commit ad0038b

Browse files
committed
Implement new SharedIndexInformer methods in FakeInformer
1 parent 2b4b7c4 commit ad0038b

File tree

1 file changed

+13
-0
lines changed
  • pkg/controller/controllertest

1 file changed

+13
-0
lines changed

pkg/controller/controllertest/util.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package controllertest
1818

1919
import (
20+
"context"
2021
"time"
2122

2223
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
@@ -109,6 +110,10 @@ func (f *FakeInformer) Run(<-chan struct{}) {
109110
f.RunCount++
110111
}
111112

113+
func (f *FakeInformer) RunWithContext(_ context.Context) {
114+
f.RunCount++
115+
}
116+
112117
// Add fakes an Add event for obj.
113118
func (f *FakeInformer) Add(obj metav1.Object) {
114119
for _, h := range f.handlers {
@@ -135,6 +140,10 @@ func (f *FakeInformer) AddEventHandlerWithResyncPeriod(handler cache.ResourceEve
135140
return nil, nil
136141
}
137142

143+
func (f *FakeInformer) AddEventHandlerWithOptions(handler cache.ResourceEventHandler, options cache.HandlerOptions) (cache.ResourceEventHandlerRegistration, error) {
144+
return nil, nil
145+
}
146+
138147
// RemoveEventHandler does nothing. TODO(community): Implement this.
139148
func (f *FakeInformer) RemoveEventHandler(handle cache.ResourceEventHandlerRegistration) error {
140149
return nil
@@ -160,6 +169,10 @@ func (f *FakeInformer) SetWatchErrorHandler(cache.WatchErrorHandler) error {
160169
return nil
161170
}
162171

172+
func (f *FakeInformer) SetWatchErrorHandlerWithContext(handler cache.WatchErrorHandlerWithContext) error {
173+
return nil
174+
}
175+
163176
// SetTransform does nothing. TODO(community): Implement this.
164177
func (f *FakeInformer) SetTransform(t cache.TransformFunc) error {
165178
return nil

0 commit comments

Comments
 (0)