Skip to content

Commit

Permalink
Continue to unpublish if volume is already unmounted
Browse files Browse the repository at this point in the history
Closes trident#572
  • Loading branch information
torirevilla authored Oct 19, 2021
1 parent 89c5b93 commit 10efaf2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions frontend/csi/node_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,12 @@ func (p *Plugin) NodeUnpublishVolume(
}

if notMountPoint {
return nil, status.Error(codes.NotFound, "volume not mounted")
}

if err = utils.WaitForUmount(ctx, targetPath, umountMaxDuration); err != nil {
Logc(ctx).WithFields(log.Fields{"path": targetPath, "error": err}).Error("unable to unmount volume.")
return nil, status.Errorf(codes.InvalidArgument, "unable to unmount volume; %s", err)
Logc(ctx).Debug( "Volume not mounted, proceeding to unpublish volume")
} else {
if err = utils.WaitForUmount(ctx, targetPath, umountMaxDuration); err != nil {
Logc(ctx).WithFields(log.Fields{"path": targetPath, "error": err}).Error("unable to unmount volume.")
return nil, status.Errorf(codes.InvalidArgument, "unable to unmount volume; %s", err)
}
}

// As per the CSI spec SP i.e. Trident is responsible for deleting the target path,
Expand Down

0 comments on commit 10efaf2

Please sign in to comment.