Skip to content

Commit

Permalink
Merge pull request #1809 from marquiz/devel/informer-cache-sync
Browse files Browse the repository at this point in the history
nfd-master: check nfd api informer cache sync result
  • Loading branch information
k8s-ci-robot committed Jul 25, 2024
2 parents 493aa0c + ea3243f commit bd8d74d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/nfd-master/nfd-api-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,15 @@ func newNfdController(config *restclient.Config, nfdApiControllerOptions nfdApiC

// Start informers
informerFactory.Start(c.stopChan)
informerFactory.WaitForCacheSync(c.stopChan)
now := time.Now()
ret := informerFactory.WaitForCacheSync(c.stopChan)
for res, ok := range ret {
if !ok {
return nil, fmt.Errorf("informer cache failed to sync resource %s", res)
}
}

klog.InfoS("informer caches synced", "duration", time.Since(now))

return c, nil
}
Expand Down

0 comments on commit bd8d74d

Please sign in to comment.