1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-04-07 01:24:33 +00:00

limit is automatically handled for you

This commit is contained in:
Igor Velichkovich 2025-01-04 19:52:22 -08:00
parent f7344ca2f9
commit 00d8fd662e

View file

@ -62,23 +62,7 @@ func NewFilteredNodeFeatureInformer(client versioned.Interface, namespace string
if tweakListOptions != nil {
tweakListOptions(&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
return client.NfdV1alpha1().NodeFeatures(namespace).List(context.TODO(), options)
},
WatchFunc: func(options v1.ListOptions) (watch.Interface, error) {
if tweakListOptions != nil {