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:
commit
094e801b6d
1 changed files with 10 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue