mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2025-06-26 18:18:24 +00:00
Add envvar to control debug logging in CDI hooks
This change allows hooks to be configured with debug logging. This is currently only enabled for the hooks generated from the runtime. Signed-off-by: Evan Lezar <elezar@nvidia.com>
This commit is contained in:
@@ -29,7 +29,7 @@ import (
|
||||
|
||||
func TestNvidiaSMISymlinkHook(t *testing.T) {
|
||||
logger, _ := testlog.NewNullLogger()
|
||||
hookCreator := discover.NewHookCreator("nvidia-cdi-hook")
|
||||
hookCreator := discover.NewHookCreator("nvidia-cdi-hook", false)
|
||||
|
||||
errMounts := errors.New("mounts error")
|
||||
|
||||
@@ -96,6 +96,7 @@ func TestNvidiaSMISymlinkHook(t *testing.T) {
|
||||
Path: "nvidia-cdi-hook",
|
||||
Args: []string{"nvidia-cdi-hook", "create-symlinks",
|
||||
"--link", "nvidia-smi::/usr/bin/nvidia-smi"},
|
||||
Env: []string{"NVIDIA_CTK_DEBUG=false"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -116,6 +117,7 @@ func TestNvidiaSMISymlinkHook(t *testing.T) {
|
||||
Path: "nvidia-cdi-hook",
|
||||
Args: []string{"nvidia-cdi-hook", "create-symlinks",
|
||||
"--link", "/some/path/nvidia-smi::/usr/bin/nvidia-smi"},
|
||||
Env: []string{"NVIDIA_CTK_DEBUG=false"},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -136,6 +138,7 @@ func TestNvidiaSMISymlinkHook(t *testing.T) {
|
||||
Path: "nvidia-cdi-hook",
|
||||
Args: []string{"nvidia-cdi-hook", "create-symlinks",
|
||||
"--link", "/some/path/nvidia-smi::/usr/bin/nvidia-smi"},
|
||||
Env: []string{"NVIDIA_CTK_DEBUG=false"},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -85,7 +85,7 @@ func New(opts ...Option) (Interface, error) {
|
||||
l.nvidiaCDIHookPath = "/usr/bin/nvidia-cdi-hook"
|
||||
}
|
||||
// create hookCreator
|
||||
l.hookCreator = discover.NewHookCreator(l.nvidiaCDIHookPath)
|
||||
l.hookCreator = discover.NewHookCreator(l.nvidiaCDIHookPath, false)
|
||||
|
||||
if l.driverRoot == "" {
|
||||
l.driverRoot = "/"
|
||||
|
||||
Reference in New Issue
Block a user