From aca93219fed5fb3a6c7cc49d71c4e17794f281ec Mon Sep 17 00:00:00 2001 From: Hamza El-Saawy Date: Wed, 11 Jun 2025 11:02:54 -0400 Subject: [PATCH] Bug: when searching for `LinuxBootFiles` Empty path was being added to lookup paths for `LinuxBootFiles`. Worked since the path was often just `C:\ContainerPlat`, but fix it regardless. Also add check to make sure the `LinuxBootFiles` path found is also a directory. Signed-off-by: Hamza El-Saawy --- test/pkg/uvm/lcow.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/pkg/uvm/lcow.go b/test/pkg/uvm/lcow.go index 9e297f3bd4..4e17122349 100644 --- a/test/pkg/uvm/lcow.go +++ b/test/pkg/uvm/lcow.go @@ -19,14 +19,14 @@ var lcowOSBootFilesOnce = sync.OnceValues(func() (string, error) { // first start with where containerd is, since there may be a leftover C:\ContainerPlat // directory from a prior install. paths := make([]string, 0, 2) - if p, err := exec.LookPath("containerd.exe"); err != nil { - paths = append(paths, p) + if p, err := exec.LookPath("containerd.exe"); err == nil { + paths = append(paths, filepath.Dir(p)) } paths = append(paths, `C:\ContainerPlat`) for _, p := range paths { p = filepath.Join(p, "LinuxBootFiles") - if _, err := os.Stat(p); err == nil { - return p, nil + if fi, err := os.Stat(p); err == nil && fi.IsDir() { + return filepath.Abs(p) } } return "", nil