From a2f73944ea3610555a7543f492ec27653c11807f Mon Sep 17 00:00:00 2001 From: Igor Velichkovich <ivelichkovich@gmail.com> Date: Sat, 4 Jan 2025 19:27:32 -0800 Subject: [PATCH] fix listing to paginate continue --- .../nfd/v1alpha1/nodefeature.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/api/generated/informers/externalversions/nfd/v1alpha1/nodefeature.go b/api/generated/informers/externalversions/nfd/v1alpha1/nodefeature.go index 4341709a7..09f6c9700 100644 --- a/api/generated/informers/externalversions/nfd/v1alpha1/nodefeature.go +++ b/api/generated/informers/externalversions/nfd/v1alpha1/nodefeature.go @@ -20,6 +20,7 @@ package v1alpha1 import ( context "context" + "go.uber.org/zap" time "time" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -62,7 +63,23 @@ func NewFilteredNodeFeatureInformer(client versioned.Interface, namespace string if tweakListOptions != nil { tweakListOptions(&options) } - return client.NfdV1alpha1().NodeFeatures(namespace).List(context.TODO(), options) + if options.Limit == 0 { + return client.NfdV1alpha1().NodeFeatures(namespace).List(context.TODO(), options) + } + featureList := &apinfdv1alpha1.NodeFeatureList{} + // do paginated list + for { + features, err := client.NfdV1alpha1().NodeFeatures(namespace).List(context.TODO(), options) + if err != nil { + return nil, err + } + featureList.Items = append(featureList.Items, features.Items...) + if features.Continue == "" { + break + } + options.Continue = features.Continue + } + return featureList, nil }, WatchFunc: func(options v1.ListOptions) (watch.Interface, error) { if tweakListOptions != nil {