Skip to content

Commit

Permalink
Modify delete access point root directory logic to only remove tempor…
Browse files Browse the repository at this point in the history
…ary directory if empty
  • Loading branch information
jrakas-dev committed Dec 18, 2024
1 parent 193b183 commit 7693a4e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/driver/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,8 @@ func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest)
if err != nil {
return nil, status.Errorf(codes.Internal, "Could not unmount %q: %v", target, err)
}
err = os.RemoveAll(target)
if err != nil {
err = os.Remove(target)
if err != nil && !os.IsNotExist(err) {
return nil, status.Errorf(codes.Internal, "Could not delete %q: %v", target, err)
}
}
Expand Down

0 comments on commit 7693a4e

Please sign in to comment.