@@ -222,7 +222,8 @@ func (c *Cache) refreshIfRequired(force bool) (bool, error) {
222
222
223
223
// InjectDevices injects the given qualified devices to an OCI Spec. It
224
224
// returns any unresolvable devices and an error if injection fails for
225
- // any of the devices.
225
+ // any of the devices. Might trigger a cache refresh, in which case any
226
+ // errors encountered can be obtained using GetErrors().
226
227
func (c * Cache ) InjectDevices (ociSpec * oci.Spec , devices ... string ) ([]string , error ) {
227
228
var unresolved []string
228
229
@@ -335,7 +336,9 @@ func (c *Cache) RemoveSpec(name string) error {
335
336
return err
336
337
}
337
338
338
- // GetDevice returns the cached device for the given qualified name.
339
+ // GetDevice returns the cached device for the given qualified name. Might trigger
340
+ // a cache refresh, in which case any errors encountered can be obtained using
341
+ // GetErrors().
339
342
func (c * Cache ) GetDevice (device string ) * Device {
340
343
c .Lock ()
341
344
defer c .Unlock ()
@@ -345,7 +348,8 @@ func (c *Cache) GetDevice(device string) *Device {
345
348
return c .devices [device ]
346
349
}
347
350
348
- // ListDevices lists all cached devices by qualified name.
351
+ // ListDevices lists all cached devices by qualified name. Might trigger a cache
352
+ // refresh, in which case any errors encountered can be obtained using GetErrors().
349
353
func (c * Cache ) ListDevices () []string {
350
354
var devices []string
351
355
@@ -362,7 +366,8 @@ func (c *Cache) ListDevices() []string {
362
366
return devices
363
367
}
364
368
365
- // ListVendors lists all vendors known to the cache.
369
+ // ListVendors lists all vendors known to the cache. Might trigger a cache refresh,
370
+ // in which case any errors encountered can be obtained using GetErrors().
366
371
func (c * Cache ) ListVendors () []string {
367
372
var vendors []string
368
373
@@ -379,7 +384,8 @@ func (c *Cache) ListVendors() []string {
379
384
return vendors
380
385
}
381
386
382
- // ListClasses lists all device classes known to the cache.
387
+ // ListClasses lists all device classes known to the cache. Might trigger a cache
388
+ // refresh, in which case any errors encountered can be obtained using GetErrors().
383
389
func (c * Cache ) ListClasses () []string {
384
390
var (
385
391
cmap = map [string ]struct {}{}
@@ -404,7 +410,8 @@ func (c *Cache) ListClasses() []string {
404
410
return classes
405
411
}
406
412
407
- // GetVendorSpecs returns all specs for the given vendor.
413
+ // GetVendorSpecs returns all specs for the given vendor. Might trigger a cache
414
+ // refresh, in which case any errors encountered can be obtained using GetErrors().
408
415
func (c * Cache ) GetVendorSpecs (vendor string ) []* Spec {
409
416
c .Lock ()
410
417
defer c .Unlock ()
0 commit comments