1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-05 08:17:04 +00:00

nfd-gc: check that node informer cache sync succeeded

This commit is contained in:
Markus Lehtonen 2024-07-26 10:29:15 +03:00
parent bd8d74d6f2
commit 454d443b72

View file

@ -18,6 +18,7 @@ package nfdgarbagecollector
import (
"context"
"fmt"
"time"
topologyclientset "github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/generated/clientset/versioned"
@ -208,7 +209,15 @@ func (n *nfdGarbageCollector) startNodeInformer() error {
// start informers
n.factory.Start(n.stopChan)
n.factory.WaitForCacheSync(n.stopChan)
start := time.Now()
ret := n.factory.WaitForCacheSync(n.stopChan)
for res, ok := range ret {
if !ok {
return fmt.Errorf("node informer cache failed to sync (%s)", res)
}
}
klog.InfoS("node informer cache synced", "duration", time.Since(start))
return nil
}