1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-17 15:58:41 +00:00

check err after client.List call when creating informer (#672)

This commit is contained in:
Chad Roberts
2025-06-12 17:03:52 -04:00
committed by GitHub
parent c67ddf2de4
commit 58f15a4349

View File

@@ -68,6 +68,9 @@ func NewInformer(ctx context.Context, client dynamic.ResourceInterface, fields [
listWatcher := &cache.ListWatch{
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
a, err := client.List(ctx, options)
if err != nil {
return nil, err
}
// We want the list to be consistent when there are going to be relists
sort.SliceStable(a.Items, func(i int, j int) bool {
var err error