@@ -116,7 +116,7 @@ func (c *Cache) configure(options ...Option) {
116116 c .watch .setup (c .specDirs , c .dirErrors )
117117 c .watch .start (& c .Mutex , c .refresh , c .dirErrors )
118118 }
119- c .refresh ()
119+ _ = c .refresh () // we record but ignore errors
120120}
121121
122122// Refresh rescans the CDI Spec directories and refreshes the Cache.
@@ -233,7 +233,7 @@ func (c *Cache) InjectDevices(ociSpec *oci.Spec, devices ...string) ([]string, e
233233 c .Lock ()
234234 defer c .Unlock ()
235235
236- c .refreshIfRequired (false )
236+ _ , _ = c .refreshIfRequired (false ) // we record but ignore errors
237237
238238 edits := & ContainerEdits {}
239239 specs := map [* Spec ]struct {}{}
@@ -340,7 +340,7 @@ func (c *Cache) GetDevice(device string) *Device {
340340 c .Lock ()
341341 defer c .Unlock ()
342342
343- c .refreshIfRequired (false )
343+ _ , _ = c .refreshIfRequired (false ) // we record but ignore errors
344344
345345 return c .devices [device ]
346346}
@@ -352,7 +352,7 @@ func (c *Cache) ListDevices() []string {
352352 c .Lock ()
353353 defer c .Unlock ()
354354
355- c .refreshIfRequired (false )
355+ _ , _ = c .refreshIfRequired (false ) // we record but ignore errors
356356
357357 for name := range c .devices {
358358 devices = append (devices , name )
@@ -369,7 +369,7 @@ func (c *Cache) ListVendors() []string {
369369 c .Lock ()
370370 defer c .Unlock ()
371371
372- c .refreshIfRequired (false )
372+ _ , _ = c .refreshIfRequired (false ) // we record but ignore errors
373373
374374 for vendor := range c .specs {
375375 vendors = append (vendors , vendor )
@@ -389,7 +389,7 @@ func (c *Cache) ListClasses() []string {
389389 c .Lock ()
390390 defer c .Unlock ()
391391
392- c .refreshIfRequired (false )
392+ _ , _ = c .refreshIfRequired (false ) // we record but ignore errors
393393
394394 for _ , specs := range c .specs {
395395 for _ , spec := range specs {
@@ -409,7 +409,7 @@ func (c *Cache) GetVendorSpecs(vendor string) []*Spec {
409409 c .Lock ()
410410 defer c .Unlock ()
411411
412- c .refreshIfRequired (false )
412+ _ , _ = c .refreshIfRequired (false ) // we record but ignore errors
413413
414414 return c .specs [vendor ]
415415}
@@ -544,7 +544,7 @@ func (w *watch) watch(fsw *fsnotify.Watcher, m *sync.Mutex, refresh func() error
544544 } else {
545545 w .update (dirErrors )
546546 }
547- refresh ()
547+ _ = refresh ()
548548 m .Unlock ()
549549
550550 case _ , ok := <- watch .Errors :
0 commit comments