Skip to content

Commit 3a6acd8

Browse files
committed
In dir-mode Delete(), remove temporary directory only if empty
1 parent 0511c03 commit 3a6acd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/driver/provisioner_dir.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func (d DirectoryProvisioner) Delete(ctx context.Context, req *csi.DeleteVolumeR
185185
} else {
186186
// If it is nil then it's safe to try and delete the directory as it should now be empty
187187
klog.V(5).Infof("Deleting temporary directory at '%s'", target)
188-
if err := d.osClient.RemoveAll(target); err != nil {
188+
if err := d.osClient.Remove(target); err != nil && !os.IsNotExist(err) {
189189
e = status.Errorf(codes.Internal, "Could not delete %q: %v", target, err)
190190
}
191191
}

0 commit comments

Comments
 (0)