Merge pull request #130470 from p0lyn0mial/upstream-fake-client-opts-watch

client-go/gentype/fake: sets opts.Watch true
This commit is contained in:
Kubernetes Prow Robot
2025-03-07 05:21:52 -08:00
committed by GitHub

View File

@@ -183,6 +183,7 @@ func (l *alsoFakeLister[T, L]) List(ctx context.Context, opts metav1.ListOptions
// Watch returns a watch.Interface that watches the requested resources. // Watch returns a watch.Interface that watches the requested resources.
func (c *FakeClient[T]) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { func (c *FakeClient[T]) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.Fake. return c.Fake.
InvokesWatch(testing.NewWatchActionWithOptions(c.resource, c.ns, opts)) InvokesWatch(testing.NewWatchActionWithOptions(c.resource, c.ns, opts))
} }