diff --git a/pkg/nvcdi/spec/spec.go b/pkg/nvcdi/spec/spec.go index 6594466e..c27c4de3 100644 --- a/pkg/nvcdi/spec/spec.go +++ b/pkg/nvcdi/spec/spec.go @@ -47,12 +47,11 @@ func (s *spec) Save(path string) error { } specDir := filepath.Dir(path) - registry := cdi.GetRegistry( + cache, _ := cdi.NewCache( cdi.WithAutoRefresh(false), cdi.WithSpecDirs(specDir), ) - - if err := registry.SpecDB().WriteSpec(s.Raw(), filepath.Base(path)); err != nil { + if err := cache.WriteSpec(s.Raw(), filepath.Base(path)); err != nil { return fmt.Errorf("failed to write spec: %w", err) }