From c06d8ee0a5c66631a774ff4e25e541915354a46a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Efe=20G=C3=B6kdemir?= Date: Thu, 1 Oct 2026 22:56:44 +0300 Subject: [PATCH] fix: clarify invalid container root errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Efe Gökdemir --- cmd/nvidia-cdi-hook/update-ldcache/update-ldcache.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/nvidia-cdi-hook/update-ldcache/update-ldcache.go b/cmd/nvidia-cdi-hook/update-ldcache/update-ldcache.go index 7bf5ad5f8..19563e455 100644 --- a/cmd/nvidia-cdi-hook/update-ldcache/update-ldcache.go +++ b/cmd/nvidia-cdi-hook/update-ldcache/update-ldcache.go @@ -111,8 +111,11 @@ func (m command) run(_ *cli.Command, cfg *options) error { } containerRootDir, err := s.GetContainerRoot() - if err != nil || containerRootDir == "" || containerRootDir == "/" { - return fmt.Errorf("failed to determined container root: %v", err) + if err != nil { + return fmt.Errorf("failed to determine container root: %w", err) + } + if containerRootDir == "" || containerRootDir == "/" { + return errors.New("failed to determine container root: invalid root") } runner, err := ldconfig.NewRunner(