Skip to content

Commit

Permalink
Combine two "if" conditionals.
Browse files Browse the repository at this point in the history
As suggested by Alexander.

Signed-off-by: Maya Rashish <mrashish@redhat.com>
  • Loading branch information
maya-r committed Feb 25, 2021
1 parent 426140d commit 17f91cd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/controller/datavolume-controller.go
Expand Up @@ -655,11 +655,7 @@ func (r *DatavolumeReconciler) getCloneStrategy() (cdiv1.CDICloneStrategy, error
return cdiv1.CloneStrategySnapshot, fmt.Errorf("no active CDI")
}

if cr.Spec.Config == nil {
return cdiv1.CloneStrategySnapshot, nil
}

if cr.Spec.Config.CloneStrategyOverride == nil {
if cr.Spec.Config == nil || cr.Spec.Config.CloneStrategyOverride == nil {
return cdiv1.CloneStrategySnapshot, nil
}

Expand Down

0 comments on commit 17f91cd

Please sign in to comment.