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:
parent
f7344ca2f9
commit
00d8fd662e
1 changed files with 1 additions and 17 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue