Skip to content

Commit ea3243f

Browse files
committed
nfd-master: check nfd api informer cache sync result
Bail out if there were errors in syncing the cache of any resource.
1 parent 493aa0c commit ea3243f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/nfd-master/nfd-api-controller.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,15 @@ func newNfdController(config *restclient.Config, nfdApiControllerOptions nfdApiC
161161

162162
// Start informers
163163
informerFactory.Start(c.stopChan)
164-
informerFactory.WaitForCacheSync(c.stopChan)
164+
now := time.Now()
165+
ret := informerFactory.WaitForCacheSync(c.stopChan)
166+
for res, ok := range ret {
167+
if !ok {
168+
return nil, fmt.Errorf("informer cache failed to sync resource %s", res)
169+
}
170+
}
171+
172+
klog.InfoS("informer caches synced", "duration", time.Since(now))
165173

166174
return c, nil
167175
}

0 commit comments

Comments
 (0)