Bump tags.cncf.io/container-device-interface to v0.7.1

This includes migrating from cdi.GetRegistry() to cdi.Configure() and
using top-level cdi Refresh and InjectDevices functions as applicable.

Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
Evan Lezar
2024-04-05 17:13:39 +02:00
parent ac8f7698cf
commit 1b62224181
19 changed files with 278 additions and 149 deletions

View File

@@ -1651,8 +1651,7 @@ func WithCDIDevices(devices ...string) SpecOpts {
return nil
}
registry := cdi.GetRegistry()
if err := registry.Refresh(); err != nil {
if err := cdi.Refresh(); err != nil {
// We don't consider registry refresh failure a fatal error.
// For instance, a dynamically generated invalid CDI Spec file for
// any particular vendor shouldn't prevent injection of devices of
@@ -1661,7 +1660,7 @@ func WithCDIDevices(devices ...string) SpecOpts {
log.G(ctx).Warnf("CDI registry refresh failed: %v", err)
}
if _, err := registry.InjectDevices(s, devices...); err != nil {
if _, err := cdi.InjectDevices(s, devices...); err != nil {
return fmt.Errorf("CDI device injection failed: %w", err)
}