client-go/gentype/fake: sets opts.Watch true

This commit is contained in:
Lukasz Szaszkiewicz 2025-02-27 12:11:47 +01:00
parent a18b4a8d97
commit f73f6fd2ab

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.
func (c *FakeClient[T]) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
return c.Fake.
InvokesWatch(testing.NewWatchActionWithOptions(c.resource, c.ns, opts))
}