mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-21 15:57:49 +00:00
Handle case were runtime name is set to predefined name
Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
parent
62d88e7c95
commit
cc7a6f166b
@ -84,8 +84,13 @@ func (r *Runtimes) add(runtime Runtime) {
|
||||
// nvidiaRuntime creates a runtime that corresponds to the nvidia runtime.
|
||||
// If the nvidiaRuntimeName is specified, this name us used unless this is exactly equal to nvidia-experimental.
|
||||
func (c config) nvidiaRuntime() Runtime {
|
||||
predefinedRuntimes := map[string]struct{}{
|
||||
"nvidia-experimental": {},
|
||||
"nvidia-cdi": {},
|
||||
"nvidia-legacy": {},
|
||||
}
|
||||
name := c.nvidiaRuntimeName
|
||||
if name == experimentalRuntimeName {
|
||||
if _, isPredefinedRuntime := predefinedRuntimes[name]; isPredefinedRuntime {
|
||||
name = defaultRuntimeName
|
||||
}
|
||||
return c.newRuntime(name, "nvidia-container-runtime")
|
||||
|
Loading…
Reference in New Issue
Block a user