Skip to content

Commit 094e801

Browse files
authored
Merge pull request #1812 from marquiz/devel/gc-cache-sync
nfd-gc: check that node informer cache sync succeeded
2 parents bd8d74d + 454d443 commit 094e801

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pkg/nfd-gc/nfd-gc.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package nfdgarbagecollector
1818

1919
import (
2020
"context"
21+
"fmt"
2122
"time"
2223

2324
topologyclientset "github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/generated/clientset/versioned"
@@ -208,7 +209,15 @@ func (n *nfdGarbageCollector) startNodeInformer() error {
208209

209210
// start informers
210211
n.factory.Start(n.stopChan)
211-
n.factory.WaitForCacheSync(n.stopChan)
212+
213+
start := time.Now()
214+
ret := n.factory.WaitForCacheSync(n.stopChan)
215+
for res, ok := range ret {
216+
if !ok {
217+
return fmt.Errorf("node informer cache failed to sync (%s)", res)
218+
}
219+
}
220+
klog.InfoS("node informer cache synced", "duration", time.Since(start))
212221

213222
return nil
214223
}

0 commit comments

Comments
 (0)