From fd2b35494095ccf7b06fb210305406f83ed17998 Mon Sep 17 00:00:00 2001 From: chrislusf Date: Wed, 3 Dec 2025 20:05:10 -0800 Subject: fix: use RemoveAll for more robust staging path cleanup Address gemini-code-assist review - use os.RemoveAll instead of os.Remove to handle cases where the directory is not empty after an imperfect unmount. This ensures complete cleanup of stale staging paths. --- pkg/driver/mount_util.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/driver/mount_util.go b/pkg/driver/mount_util.go index 200817d..50c78d2 100644 --- a/pkg/driver/mount_util.go +++ b/pkg/driver/mount_util.go @@ -74,8 +74,9 @@ func cleanupStaleStagingPath(stagingPath string) error { } // Check if directory still exists and remove it + // Use RemoveAll to handle cases where directory is not empty after imperfect unmount if _, err := os.Stat(stagingPath); err == nil { - if err := os.Remove(stagingPath); err != nil { + if err := os.RemoveAll(stagingPath); err != nil { glog.Warningf("failed to remove staging path %s: %v", stagingPath, err) return err } -- cgit v1.2.3