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

client-go/metadata/fake: sets opts.Watch to true

Kubernetes-commit: 3a99a64438d7f15e170889181f93bb1dc48c4888
This commit is contained in:
Kubernetes Publisher 2025-07-24 09:38:49 -07:00
commit f4919f808e

View File

@ -354,6 +354,7 @@ func (c *metadataResourceClient) List(ctx context.Context, opts metav1.ListOptio
} }
func (c *metadataResourceClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { func (c *metadataResourceClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) {
opts.Watch = true
switch { switch {
case len(c.namespace) == 0: case len(c.namespace) == 0:
return c.client.Fake. return c.client.Fake.
@ -362,7 +363,6 @@ func (c *metadataResourceClient) Watch(ctx context.Context, opts metav1.ListOpti
case len(c.namespace) > 0: case len(c.namespace) > 0:
return c.client.Fake. return c.client.Fake.
InvokesWatch(testing.NewWatchAction(c.resource, c.namespace, opts)) InvokesWatch(testing.NewWatchAction(c.resource, c.namespace, opts))
} }
panic("math broke") panic("math broke")