1
0
Fork 0
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:
Markus Lehtonen 2024-07-25 08:49:43 +03:00
parent 493aa0c80e
commit ea3243fb00

View file

@ -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
}