From a7b401a38c6d87e738eff64af6c7da7c3745d31d Mon Sep 17 00:00:00 2001 From: Derick Diaz Date: Sun, 28 Jan 2024 19:22:53 -0600 Subject: [PATCH] fix error --- pkg/rke2/rke2_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/rke2/rke2_linux.go b/pkg/rke2/rke2_linux.go index e6d0e06c36..f238675690 100644 --- a/pkg/rke2/rke2_linux.go +++ b/pkg/rke2/rke2_linux.go @@ -532,14 +532,14 @@ func cleanupDataDir(dataDir string) error { // Ensures file is a directory, has rke2 within the name, and is not an active path // if the function is unable to clear out the diretory, the error is ignored. - err := filepath.WalkDir(path, func(path string, info fs.DirEntry, err error) error { + err = filepath.WalkDir(path, func(path string, info fs.DirEntry, err error) error { if !info.IsDir() || !string.Contains(path, "rke2") || slices.Contains(activePaths, path) { continue } _ := os.RemoveAll(path) }) - return nil + return err } func getProcessExecutablePaths() ([]string, error) {