Implement idempotent cleanup behavior

This commit is contained in:
2026-09-05 15:15:28 +00:00
parent 563acce012
commit 8d9eb5cc40
6 changed files with 420 additions and 1 deletions

View File

@@ -13,6 +13,9 @@ import (
func RemoveAllUnderRoot(rootPath, target string) error {
root, targetName, err := openCleanupRoot(rootPath, target)
if err != nil {
if errors.Is(err, os.ErrNotExist) {
return nil
}
return err
}
defer func() { _ = root.Close() }()