We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 9805f6f + 145cd82 commit fe602ceCopy full SHA for fe602ce
1 file changed
pkg/cdi/cache.go
@@ -409,7 +409,17 @@ func (c *Cache) GetVendorSpecs(vendor string) []*Spec {
409
// GetSpecErrors returns all errors encountered for the spec during the
410
// last cache refresh.
411
func (c *Cache) GetSpecErrors(spec *Spec) []error {
412
- return c.errors[spec.GetPath()]
+ var errors []error
413
+
414
+ c.Lock()
415
+ defer c.Unlock()
416
417
+ if errs, ok := c.errors[spec.GetPath()]; ok {
418
+ errors = make([]error, len(errs))
419
+ copy(errors, errs)
420
+ }
421
422
+ return errors
423
}
424
425
// GetErrors returns all errors encountered during the last
0 commit comments