Merge branch 'CNT-4285/add-runtime-hook-path' into 'main'

Add nvidia-contianer-runtime-hook.path config option

See merge request nvidia/container-toolkit/container-toolkit!401
This commit is contained in:
Evan Lezar
2023-05-26 08:29:52 +00:00
committed by Evan Lezar
parent 7386f86904
commit 2d7bb636b9
12 changed files with 88 additions and 28 deletions

View File

@@ -63,6 +63,10 @@ func (r rt) Run(argv []string) (rerr error) {
r.logger.Reset()
}()
// We apply some config updates here to ensure that the config is valid in
// all cases.
cfg.NVIDIAContainerRuntimeHookConfig.Path = config.ResolveNVIDIAContainerRuntimeHookPath(r.logger.Logger, cfg.NVIDIAContainerRuntimeHookConfig.Path)
// Print the config to the output.
configJSON, err := json.MarshalIndent(cfg, "", " ")
if err == nil {

View File

@@ -99,7 +99,7 @@ func newSpecModifier(logger *logrus.Logger, cfg *config.Config, ociSpec oci.Spec
func newModeModifier(logger *logrus.Logger, cfg *config.Config, ociSpec oci.Spec, argv []string) (oci.SpecModifier, error) {
switch info.ResolveAutoMode(logger, cfg.NVIDIAContainerRuntimeConfig.Mode) {
case "legacy":
return modifier.NewStableRuntimeModifier(logger), nil
return modifier.NewStableRuntimeModifier(logger, cfg.NVIDIAContainerRuntimeHookConfig.Path), nil
case "csv":
return modifier.NewCSVModifier(logger, cfg, ociSpec)
case "cdi":