feat(zfspv): remove finalizer that is owned by ZFS-LocalPV (#303)

We set the Finalizer to nil while handling the delete event, instead,
we should try to destroy the volume when there are no user finalizers
set. User might have added his own finalizers and we should not try to destroy
the volumes until those user finalizers are removed.

Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
Pawan Prakash Sharma 2021-04-06 20:03:00 +05:30 committed by GitHub
parent 9888968fd7
commit 68d79d0e0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 58 additions and 24 deletions

View file

@ -134,7 +134,7 @@ func verifyMountRequest(vol *apis.ZFSVolume, mountpath string) (bool, error) {
vol.Spec.OwnerNodeID != NodeID {
return false, status.Error(codes.Internal, "verifyMount: volume is owned by different node")
}
if vol.Finalizers == nil {
if !IsVolumeReady(vol) {
return false, status.Error(codes.Internal, "verifyMount: volume is not ready to be mounted")
}