mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Check returned error values
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -52,7 +52,9 @@ func (i additionalInfo) UsesNVGPUModule() (uses bool, reason string) {
|
||||
if ret != nvml.SUCCESS {
|
||||
return false, fmt.Sprintf("failed to initialize nvml: %v", ret)
|
||||
}
|
||||
defer i.nvmllib.Shutdown()
|
||||
defer func() {
|
||||
_ = i.nvmllib.Shutdown()
|
||||
}()
|
||||
|
||||
var names []string
|
||||
|
||||
|
||||
@@ -22,7 +22,8 @@ func TestMaintainSpec(t *testing.T) {
|
||||
|
||||
spec := NewFileSpec(inputSpecPath).(*fileSpec)
|
||||
|
||||
spec.Load()
|
||||
_, err := spec.Load()
|
||||
require.NoError(t, err)
|
||||
|
||||
outputSpecPath := filepath.Join(moduleRoot, "test/output", f)
|
||||
spec.path = outputSpecPath
|
||||
|
||||
@@ -18,6 +18,7 @@ package runtime
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
@@ -53,7 +54,9 @@ func (r rt) Run(argv []string) (rerr error) {
|
||||
if rerr != nil {
|
||||
r.logger.Errorf("%v", rerr)
|
||||
}
|
||||
r.logger.Reset()
|
||||
if err := r.logger.Reset(); err != nil {
|
||||
rerr = errors.Join(rerr, fmt.Errorf("failed to reset logger: %v", err))
|
||||
}
|
||||
}()
|
||||
|
||||
// We apply some config updates here to ensure that the config is valid in
|
||||
|
||||
Reference in New Issue
Block a user