From bc356d37e9451114a746b9d08b608de1fe4fd9e2 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Thu, 13 Jun 2024 21:21:44 -0400 Subject: [PATCH] remove the default resource list limit Signed-off-by: Wei Liu --- pkg/client/cloudevents/grpcsource/watcherstore.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/client/cloudevents/grpcsource/watcherstore.go b/pkg/client/cloudevents/grpcsource/watcherstore.go index 4ae5e020..ac81aa18 100644 --- a/pkg/client/cloudevents/grpcsource/watcherstore.go +++ b/pkg/client/cloudevents/grpcsource/watcherstore.go @@ -107,8 +107,15 @@ func (m *RESTFulAPIWatcherStore) Get(namespace, name string) (*workv1.ManifestWo func (m *RESTFulAPIWatcherStore) List(opts metav1.ListOptions) ([]*workv1.ManifestWork, error) { works := []*workv1.ManifestWork{} + var size int32 = -1 + if opts.Limit > 0 { + size = int32(opts.Limit) + } + apiRequest := m.apiClient.DefaultApi.ApiMaestroV1ResourceBundlesGet(context.Background()). - Search(fmt.Sprintf("source = '%s'", m.sourceID)) + Search(fmt.Sprintf("source = '%s'", m.sourceID)). + Page(1). // TODO consider how to support this + Size(size) // TODO filter works by labels