From 429ef4d4e9b476c10cb5797ff8fd7e7e4db26767 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Mon, 14 Nov 2022 12:19:59 +0100 Subject: [PATCH] Make NewVisibleDevices public Signed-off-by: Evan Lezar --- internal/config/image/cuda_image.go | 6 +++--- internal/config/image/devices.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/config/image/cuda_image.go b/internal/config/image/cuda_image.go index b30e27fa..4a255cb5 100644 --- a/internal/config/image/cuda_image.go +++ b/internal/config/image/cuda_image.go @@ -135,15 +135,15 @@ func (i CUDA) DevicesFromEnvvars(envVars ...string) VisibleDevices { // Environment variable unset with legacy image: default to "all". if !isSet && len(devices) == 0 && i.IsLegacy() { - return newVisibleDevices("all") + return NewVisibleDevices("all") } // Environment variable unset or empty or "void": return nil if len(devices) == 0 || requested["void"] { - return newVisibleDevices("void") + return NewVisibleDevices("void") } - return newVisibleDevices(devices...) + return NewVisibleDevices(devices...) } // GetDriverCapabilities returns the requested driver capabilities. diff --git a/internal/config/image/devices.go b/internal/config/image/devices.go index 125bcc0e..f5a6ad95 100644 --- a/internal/config/image/devices.go +++ b/internal/config/image/devices.go @@ -32,8 +32,8 @@ var _ VisibleDevices = (*none)(nil) var _ VisibleDevices = (*void)(nil) var _ VisibleDevices = (*devices)(nil) -// newVisibleDevices creates a VisibleDevices based on the value of the specified envvar. -func newVisibleDevices(envvars ...string) VisibleDevices { +// NewVisibleDevices creates a VisibleDevices based on the value of the specified envvar. +func NewVisibleDevices(envvars ...string) VisibleDevices { for _, envvar := range envvars { if envvar == "all" { return all{}