1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

Merge pull request #1812 from marquiz/devel/gc-cache-sync

nfd-gc: check that node informer cache sync succeeded
This commit is contained in:
Kubernetes Prow Robot 2024-07-26 07:34:14 -07:00 committed by GitHub
commit 094e801b6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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
}