From 4791fab747273fe7aa6aad4b07b82d7e4c849212 Mon Sep 17 00:00:00 2001 From: Kevin Klues Date: Thu, 23 Jul 2020 10:36:38 +0000 Subject: [PATCH] Simplify getMigConfigDevices() and getMigMonitorDevices() Signed-off-by: Kevin Klues --- pkg/container_config.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/pkg/container_config.go b/pkg/container_config.go index b7648ac7..12bb5b9b 100644 --- a/pkg/container_config.go +++ b/pkg/container_config.go @@ -214,21 +214,15 @@ func getDevices(env map[string]string) *string { } func getMigConfigDevices(env map[string]string) *string { - gpuVars := []string{envNVMigConfigDevices} - for _, gpuVar := range gpuVars { - if devices, ok := env[gpuVar]; ok { - return &devices - } + if devices, ok := env[envNVMigConfigDevices]; ok { + return &devices } return nil } func getMigMonitorDevices(env map[string]string) *string { - gpuVars := []string{envNVMigMonitorDevices} - for _, gpuVar := range gpuVars { - if devices, ok := env[gpuVar]; ok { - return &devices - } + if devices, ok := env[envNVMigMonitorDevices]; ok { + return &devices } return nil }