mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 06:20:11 +01:00
fix(zfspv): mounting the volume if it is ready
Instead of checking for the finalizer, checking for the volume state to be ready is more intuitive before mounting it. Also removed duplicate if statement for btrfs which was added while resolveing the merge conflict in https://github.com/openebs/zfs-localpv/pull/175. Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
parent
b6b4f0bb52
commit
e00a6b9ae2
3 changed files with 3 additions and 8 deletions
|
|
@ -139,8 +139,8 @@ func verifyMountRequest(vol *apis.ZFSVolume, mountpath string) error {
|
|||
vol.Spec.OwnerNodeID != NodeID {
|
||||
return status.Error(codes.Internal, "verifyMount: volume is owned by different node")
|
||||
}
|
||||
if vol.Finalizers == nil {
|
||||
return status.Error(codes.Internal, "verifyMount: volume is not ready, driver has not yet set the finalizer")
|
||||
if vol.Status.State != ZFSStatusReady {
|
||||
return status.Error(codes.Internal, "verifyMount: volume is not ready to be mounted")
|
||||
}
|
||||
|
||||
devicePath, err := GetVolumeDevPath(vol)
|
||||
|
|
|
|||
|
|
@ -370,12 +370,6 @@ func CreateClone(vol *apis.ZFSVolume) error {
|
|||
if vol.Spec.FsType == "btrfs" {
|
||||
return btrfsGenerateUUID(volume)
|
||||
}
|
||||
if vol.Spec.FsType == "btrfs" {
|
||||
return btrfsGenerateUUID(volume)
|
||||
}
|
||||
if vol.Spec.FsType == "btrfs" {
|
||||
return btrfsGenerateUUID(volume)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue