Skip to content

Commit

Permalink
Lint errors
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Gershkovich <[email protected]>
  • Loading branch information
ELENAGER committed Nov 29, 2023
1 parent a075fd6 commit 45fb73f
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions controllers/drplacementcontrol.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,28 +535,21 @@ func (d *DRPCInstance) checkMetroFailoverPrerequisites(curHomeCluster string) (b
func (d *DRPCInstance) checkRegionalFailoverPrerequisites() bool {
d.setProgression(rmn.ProgressionWaitForStorageMaintenanceActivation)

var drFailoverCluster *rmn.DRCluster

for _, drCluster := range d.drClusters {
if drCluster.Name != d.instance.Spec.FailoverCluster {
continue
}
drFailoverCluster = &drCluster

break
}

if drFailoverCluster != nil {
if required, activationsRequired := requiresRegionalFailoverPrerequisites(

Check failure on line 542 in controllers/drplacementcontrol.go

View workflow job for this annotation

GitHub Actions / Golangci Lint

if statements should only be cuddled with assignments (wsl)
d.ctx,
d.reconciler.APIReader,
rmnutil.DRPolicyS3Profiles(d.drPolicy, []rmn.DRCluster{*drFailoverCluster}).List(),
rmnutil.DRPolicyS3Profiles(d.drPolicy, []rmn.DRCluster{drCluster}).List(),
d.instance.GetName(), d.instance.GetNamespace(),
d.vrgs, d.instance.Spec.FailoverCluster,
d.reconciler.ObjStoreGetter, d.log); required {

return checkFailoverMaintenanceActivations(*drFailoverCluster, activationsRequired, d.log)
return checkFailoverMaintenanceActivations(drCluster, activationsRequired, d.log)
}

break
}

return true
Expand Down

0 comments on commit 45fb73f

Please sign in to comment.