Skip to content

Commit

Permalink
Merge pull request #1812 from marquiz/devel/gc-cache-sync
Browse files Browse the repository at this point in the history
nfd-gc: check that node informer cache sync succeeded
  • Loading branch information
k8s-ci-robot committed Jul 26, 2024
2 parents bd8d74d + 454d443 commit 094e801
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/nfd-gc/nfd-gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package nfdgarbagecollector

import (
"context"
"fmt"
"time"

topologyclientset "github.com/k8stopologyawareschedwg/noderesourcetopology-api/pkg/generated/clientset/versioned"
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 094e801

Please sign in to comment.