mirror of
https://github.com/rancher/steve.git
synced 2025-08-14 12:35:24 +00:00
check err after client.List call when creating informer (#672)
This commit is contained in:
parent
c67ddf2de4
commit
58f15a4349
@ -68,6 +68,9 @@ func NewInformer(ctx context.Context, client dynamic.ResourceInterface, fields [
|
|||||||
listWatcher := &cache.ListWatch{
|
listWatcher := &cache.ListWatch{
|
||||||
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
ListFunc: func(options metav1.ListOptions) (runtime.Object, error) {
|
||||||
a, err := client.List(ctx, options)
|
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
|
// We want the list to be consistent when there are going to be relists
|
||||||
sort.SliceStable(a.Items, func(i int, j int) bool {
|
sort.SliceStable(a.Items, func(i int, j int) bool {
|
||||||
var err error
|
var err error
|
||||||
|
Loading…
Reference in New Issue
Block a user