Simplify getMigConfigDevices() and getMigMonitorDevices()

Signed-off-by: Kevin Klues <kklues@nvidia.com>
This commit is contained in:
Kevin Klues 2020-07-23 10:36:38 +00:00
parent a24b0c8b4e
commit 4791fab747

View File

@ -214,21 +214,15 @@ func getDevices(env map[string]string) *string {
} }
func getMigConfigDevices(env map[string]string) *string { func getMigConfigDevices(env map[string]string) *string {
gpuVars := []string{envNVMigConfigDevices} if devices, ok := env[envNVMigConfigDevices]; ok {
for _, gpuVar := range gpuVars { return &devices
if devices, ok := env[gpuVar]; ok {
return &devices
}
} }
return nil return nil
} }
func getMigMonitorDevices(env map[string]string) *string { func getMigMonitorDevices(env map[string]string) *string {
gpuVars := []string{envNVMigMonitorDevices} if devices, ok := env[envNVMigMonitorDevices]; ok {
for _, gpuVar := range gpuVars { return &devices
if devices, ok := env[gpuVar]; ok {
return &devices
}
} }
return nil return nil
} }