mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-04-20 22:25:22 +00:00
[no-relnote] Fix QF1008: could remove embedded field lint errors
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
bee1969bbf
commit
c1c6534b1f
@ -42,7 +42,7 @@ func WithDriverDotSoSymlinks(mounts Discover, version string, nvidiaCDIHookPath
|
|||||||
|
|
||||||
// Hooks returns a hook to create the additional symlinks based on the mounts.
|
// Hooks returns a hook to create the additional symlinks based on the mounts.
|
||||||
func (d *additionalSymlinks) Hooks() ([]Hook, error) {
|
func (d *additionalSymlinks) Hooks() ([]Hook, error) {
|
||||||
mounts, err := d.Discover.Mounts()
|
mounts, err := d.Mounts()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("failed to get library mounts: %v", err)
|
return nil, fmt.Errorf("failed to get library mounts: %v", err)
|
||||||
}
|
}
|
||||||
|
@ -61,11 +61,11 @@ func (s *memorySpec) Modify(m SpecModifier) error {
|
|||||||
// Otherwise the returned value will be empty and the boolean will
|
// Otherwise the returned value will be empty and the boolean will
|
||||||
// be false.
|
// be false.
|
||||||
func (s memorySpec) LookupEnv(key string) (string, bool) {
|
func (s memorySpec) LookupEnv(key string) (string, bool) {
|
||||||
if s.Spec == nil || s.Spec.Process == nil {
|
if s.Spec == nil || s.Process == nil {
|
||||||
return "", false
|
return "", false
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, env := range s.Spec.Process.Env {
|
for _, env := range s.Process.Env {
|
||||||
if !strings.HasPrefix(env, key) {
|
if !strings.HasPrefix(env, key) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -160,7 +160,7 @@ func TestModify(t *testing.T) {
|
|||||||
require.EqualValues(t, &specs.Spec{}, spec.Spec, "%d: %v", i, tc)
|
require.EqualValues(t, &specs.Spec{}, spec.Spec, "%d: %v", i, tc)
|
||||||
default:
|
default:
|
||||||
require.NoError(t, err, "%d: %v", i, tc)
|
require.NoError(t, err, "%d: %v", i, tc)
|
||||||
require.Equal(t, "updated", spec.Spec.Version, "%d: %v", i, tc)
|
require.Equal(t, "updated", spec.Version, "%d: %v", i, tc)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user