From cd7d586afadc20d1a5caf8e0dc2a923f2e7e871c Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 9 Feb 2024 14:17:27 +0100 Subject: [PATCH] Also ignore CDI errors if required Signed-off-by: Evan Lezar --- tools/container/toolkit/toolkit.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/container/toolkit/toolkit.go b/tools/container/toolkit/toolkit.go index 0de78b25..0702386c 100644 --- a/tools/container/toolkit/toolkit.go +++ b/tools/container/toolkit/toolkit.go @@ -369,7 +369,14 @@ func Install(cli *cli.Context, opts *options) error { log.Errorf("Ignoring error: %v", fmt.Errorf("error creating device nodes: %v", err)) } - return generateCDISpec(opts, nvidiaCTKPath) + err = generateCDISpec(opts, nvidiaCTKPath) + if err != nil && !opts.ignoreErrors { + return fmt.Errorf("error generating CDI specification: %v", err) + } else if err != nil { + log.Errorf("Ignoring error: %v", fmt.Errorf("error generating CDI specification: %v", err)) + } + + return nil } // installContainerLibraries locates and installs the libraries that are part of