From 4cd86caf67450bc25084475207824929b7096d22 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 5 Apr 2024 17:09:17 +0200 Subject: [PATCH] Use NewCache instead of GetRegistry Signed-off-by: Evan Lezar --- pkg/nvcdi/spec/spec.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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) }