mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
nfd-master: check nfd api informer cache sync result
Bail out if there were errors in syncing the cache of any resource.
This commit is contained in:
parent
493aa0c80e
commit
ea3243fb00
1 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue