@@ -116,7 +116,7 @@ func (c *Cache) configure(options ...Option) {
116
116
c .watch .setup (c .specDirs , c .dirErrors )
117
117
c .watch .start (& c .Mutex , c .refresh , c .dirErrors )
118
118
}
119
- c .refresh ()
119
+ _ = c .refresh () // we record but ignore errors
120
120
}
121
121
122
122
// 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
233
233
c .Lock ()
234
234
defer c .Unlock ()
235
235
236
- c .refreshIfRequired (false )
236
+ _ , _ = c .refreshIfRequired (false ) // we record but ignore errors
237
237
238
238
edits := & ContainerEdits {}
239
239
specs := map [* Spec ]struct {}{}
@@ -340,7 +340,7 @@ func (c *Cache) GetDevice(device string) *Device {
340
340
c .Lock ()
341
341
defer c .Unlock ()
342
342
343
- c .refreshIfRequired (false )
343
+ _ , _ = c .refreshIfRequired (false ) // we record but ignore errors
344
344
345
345
return c .devices [device ]
346
346
}
@@ -352,7 +352,7 @@ func (c *Cache) ListDevices() []string {
352
352
c .Lock ()
353
353
defer c .Unlock ()
354
354
355
- c .refreshIfRequired (false )
355
+ _ , _ = c .refreshIfRequired (false ) // we record but ignore errors
356
356
357
357
for name := range c .devices {
358
358
devices = append (devices , name )
@@ -369,7 +369,7 @@ func (c *Cache) ListVendors() []string {
369
369
c .Lock ()
370
370
defer c .Unlock ()
371
371
372
- c .refreshIfRequired (false )
372
+ _ , _ = c .refreshIfRequired (false ) // we record but ignore errors
373
373
374
374
for vendor := range c .specs {
375
375
vendors = append (vendors , vendor )
@@ -389,7 +389,7 @@ func (c *Cache) ListClasses() []string {
389
389
c .Lock ()
390
390
defer c .Unlock ()
391
391
392
- c .refreshIfRequired (false )
392
+ _ , _ = c .refreshIfRequired (false ) // we record but ignore errors
393
393
394
394
for _ , specs := range c .specs {
395
395
for _ , spec := range specs {
@@ -409,7 +409,7 @@ func (c *Cache) GetVendorSpecs(vendor string) []*Spec {
409
409
c .Lock ()
410
410
defer c .Unlock ()
411
411
412
- c .refreshIfRequired (false )
412
+ _ , _ = c .refreshIfRequired (false ) // we record but ignore errors
413
413
414
414
return c .specs [vendor ]
415
415
}
@@ -544,7 +544,7 @@ func (w *watch) watch(fsw *fsnotify.Watcher, m *sync.Mutex, refresh func() error
544
544
} else {
545
545
w .update (dirErrors )
546
546
}
547
- refresh ()
547
+ _ = refresh ()
548
548
m .Unlock ()
549
549
550
550
case _ , ok := <- watch .Errors :
0 commit comments