mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 10:53:34 +00:00
cleanup: refactor deeply nested if statements in internal/rbd
Refactored deeply nested if statement in internal/rbd to reduce cognitive complexity. Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
@ -277,10 +277,10 @@ func (rv *rbdVolume) Exists(ctx context.Context, parentVol *rbdVolume) (bool, er
|
||||
// Need to check cloned info here not on createvolume,
|
||||
if parentVol != nil {
|
||||
found, cErr := rv.checkCloneImage(ctx, parentVol)
|
||||
if found && cErr == nil {
|
||||
switch {
|
||||
case found && cErr == nil:
|
||||
return true, nil
|
||||
}
|
||||
if cErr != nil {
|
||||
case cErr != nil:
|
||||
return false, cErr
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user