mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-04-02 12:00:18 +00:00
[no-relnote] Allow relative paths from operator structs
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
025407543f
commit
acaae81f8a
@ -20,8 +20,6 @@ import "path/filepath"
|
||||
|
||||
const (
|
||||
defaultRuntimeName = "nvidia"
|
||||
|
||||
defaultRoot = "/usr/bin"
|
||||
)
|
||||
|
||||
// Runtime defines a runtime to be configured.
|
||||
@ -48,9 +46,6 @@ func GetRuntimes(opts ...Option) Runtimes {
|
||||
opt(c)
|
||||
}
|
||||
|
||||
if c.root == "" {
|
||||
c.root = defaultRoot
|
||||
}
|
||||
if c.nvidiaRuntimeName == "" {
|
||||
c.nvidiaRuntimeName = defaultRuntimeName
|
||||
}
|
||||
|
@ -27,7 +27,6 @@ func TestOptions(t *testing.T) {
|
||||
testCases := []struct {
|
||||
setAsDefault bool
|
||||
nvidiaRuntimeName string
|
||||
root string
|
||||
expectedDefaultRuntime string
|
||||
expectedRuntimes Runtimes
|
||||
}{
|
||||
@ -131,7 +130,7 @@ func TestOptions(t *testing.T) {
|
||||
runtimes := GetRuntimes(
|
||||
WithNvidiaRuntimeName(tc.nvidiaRuntimeName),
|
||||
WithSetAsDefault(tc.setAsDefault),
|
||||
WithRoot(tc.root),
|
||||
WithRoot("/usr/bin"),
|
||||
)
|
||||
|
||||
require.EqualValues(t, tc.expectedRuntimes, runtimes)
|
||||
|
Loading…
Reference in New Issue
Block a user