mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-16 11:30:20 +00:00
[no-relnote] Fix QF1002: could use tagged switch on info.SubType lint errors
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
c1c6534b1f
commit
be9d7b6db1
@ -71,13 +71,13 @@ func (d *nvsandboxutilsDGPU) Devices() ([]discover.Device, error) {
|
|||||||
|
|
||||||
var devices []discover.Device
|
var devices []discover.Device
|
||||||
for _, info := range gpuFileInfos {
|
for _, info := range gpuFileInfos {
|
||||||
switch {
|
switch info.SubType {
|
||||||
case info.SubType == nvsandboxutils.NV_DEV_DRI_CARD, info.SubType == nvsandboxutils.NV_DEV_DRI_RENDERD:
|
case nvsandboxutils.NV_DEV_DRI_CARD, nvsandboxutils.NV_DEV_DRI_RENDERD:
|
||||||
if d.isMig {
|
if d.isMig {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
fallthrough
|
fallthrough
|
||||||
case info.SubType == nvsandboxutils.NV_DEV_NVIDIA, info.SubType == nvsandboxutils.NV_DEV_NVIDIA_CAPS_NVIDIA_CAP:
|
case nvsandboxutils.NV_DEV_NVIDIA, nvsandboxutils.NV_DEV_NVIDIA_CAPS_NVIDIA_CAP:
|
||||||
containerPath := info.Path
|
containerPath := info.Path
|
||||||
if d.devRoot != "/" {
|
if d.devRoot != "/" {
|
||||||
containerPath = strings.TrimPrefix(containerPath, d.devRoot)
|
containerPath = strings.TrimPrefix(containerPath, d.devRoot)
|
||||||
@ -89,7 +89,7 @@ func (d *nvsandboxutilsDGPU) Devices() ([]discover.Device, error) {
|
|||||||
Path: containerPath,
|
Path: containerPath,
|
||||||
}
|
}
|
||||||
devices = append(devices, device)
|
devices = append(devices, device)
|
||||||
case info.SubType == nvsandboxutils.NV_DEV_DRI_CARD_SYMLINK, info.SubType == nvsandboxutils.NV_DEV_DRI_RENDERD_SYMLINK:
|
case nvsandboxutils.NV_DEV_DRI_CARD_SYMLINK, nvsandboxutils.NV_DEV_DRI_RENDERD_SYMLINK:
|
||||||
if d.isMig {
|
if d.isMig {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user