mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Add hook command to nvidia-ctk with update-ldcache subcommand
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -52,7 +52,7 @@ func (s *fileSpec) Load() error {
|
||||
}
|
||||
defer specFile.Close()
|
||||
|
||||
spec, err := loadFrom(specFile)
|
||||
spec, err := LoadFrom(specFile)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error loading OCI specification from file: %v", err)
|
||||
}
|
||||
@@ -60,8 +60,8 @@ func (s *fileSpec) Load() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// loadFrom reads the contents of the OCI spec from the specified io.Reader.
|
||||
func loadFrom(reader io.Reader) (*specs.Spec, error) {
|
||||
// LoadFrom reads the contents of the OCI spec from the specified io.Reader.
|
||||
func LoadFrom(reader io.Reader) (*specs.Spec, error) {
|
||||
decoder := json.NewDecoder(reader)
|
||||
|
||||
var spec specs.Spec
|
||||
|
||||
@@ -44,7 +44,7 @@ func TestLoadFrom(t *testing.T) {
|
||||
|
||||
for i, tc := range testCases {
|
||||
var spec *specs.Spec
|
||||
spec, err := loadFrom(bytes.NewReader(tc.contents))
|
||||
spec, err := LoadFrom(bytes.NewReader(tc.contents))
|
||||
|
||||
if tc.isError {
|
||||
require.Error(t, err, "%d: %v", i, tc)
|
||||
|
||||
Reference in New Issue
Block a user