mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-24 21:14:00 +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)
|
specDir := filepath.Dir(path)
|
||||||
registry := cdi.GetRegistry(
|
cache, _ := cdi.NewCache(
|
||||||
cdi.WithAutoRefresh(false),
|
cdi.WithAutoRefresh(false),
|
||||||
cdi.WithSpecDirs(specDir),
|
cdi.WithSpecDirs(specDir),
|
||||||
)
|
)
|
||||||
|
if err := cache.WriteSpec(s.Raw(), filepath.Base(path)); err != nil {
|
||||||
if err := registry.SpecDB().WriteSpec(s.Raw(), filepath.Base(path)); err != nil {
|
|
||||||
return fmt.Errorf("failed to write spec: %w", err)
|
return fmt.Errorf("failed to write spec: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user