Skip to content

Commit be0cc9d

Browse files
committed
Add nvidia-container-runtime.runtimes config option
This change adds an nvidia-container-runtime.runtimes config option. If this is unset no changes are made to the config and the default values are used. This allows this setting to be overridden in cases where this is required. One such example is crio where crun is set as the default runtime. Signed-off-by: Evan Lezar <[email protected]>
1 parent 4d5ba09 commit be0cc9d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/container/toolkit/toolkit.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ type options struct {
5353
ContainerRuntimeModesCdiDefaultKind string
5454
ContainerRuntimeModesCDIAnnotationPrefixes cli.StringSlice
5555

56+
ContainerRuntimeRuntimes cli.StringSlice
57+
5658
ContainerRuntimeHookSkipModeDetection bool
5759

5860
ContainerCLIDebug string
@@ -152,6 +154,11 @@ func main() {
152154
Destination: &opts.ContainerRuntimeModesCDIAnnotationPrefixes,
153155
EnvVars: []string{"NVIDIA_CONTAINER_RUNTIME_MODES_CDI_ANNOTATION_PREFIXES"},
154156
},
157+
&cli.StringSliceFlag{
158+
Name: "nvidia-container-runtime.runtimes",
159+
Destination: &opts.ContainerRuntimeRuntimes,
160+
EnvVars: []string{"NVIDIA_CONTAINER_RUNTIME_RUNTIMES"},
161+
},
155162
&cli.BoolFlag{
156163
Name: "nvidia-container-runtime-hook.skip-mode-detection",
157164
Value: true,
@@ -415,6 +422,7 @@ func installToolkitConfig(c *cli.Context, toolkitConfigPath string, nvidiaContai
415422
"nvidia-container-runtime.mode": opts.ContainerRuntimeMode,
416423
"nvidia-container-runtime.modes.cdi.annotation-prefixes": opts.ContainerRuntimeModesCDIAnnotationPrefixes,
417424
"nvidia-container-runtime.modes.cdi.default-kind": opts.ContainerRuntimeModesCdiDefaultKind,
425+
"nvidia-container-runtime.runtimes": opts.ContainerRuntimeRuntimes,
418426
"nvidia-container-cli.debug": opts.ContainerCLIDebug,
419427
}
420428
for key, value := range optionalConfigValues {

0 commit comments

Comments
 (0)