Skip to content

Commit 7a43a3b

Browse files
committed
In dir-mode Delete(), remove temporary directory only if empty
1 parent 774d37d commit 7a43a3b

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
@@ -190,7 +190,7 @@ func (d DirectoryProvisioner) Delete(ctx context.Context, req *csi.DeleteVolumeR
190190
} else {
191191
// If it is nil then it's safe to try and delete the directory as it should now be empty
192192
klog.V(5).Infof("Deleting temporary directory at '%s'", target)
193-
if err := d.osClient.RemoveAll(target); err != nil {
193+
if err := d.osClient.Remove(target); err != nil && !os.IsNotExist(err) {
194194
e = status.Errorf(codes.Internal, "Could not delete %q: %v", target, err)
195195
}
196196
}

0 commit comments

Comments
 (0)