mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-21 15:57:49 +00:00
Use NewCache instead of GetRegistry
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
885313af3b
commit
4cd86caf67
@ -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)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user