Skip to content

Commit

Permalink
Remove unneeded blank lines before return
Browse files Browse the repository at this point in the history
In drcluster module and tests. This was not possible before because of
bad default in golangci-lint nlreturn rule.

Signed-off-by: Nir Soffer <nsoffer@redhat.com>
  • Loading branch information
nirs committed Jul 4, 2023
1 parent d31baef commit c0977b5
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
13 changes: 0 additions & 13 deletions controllers/drcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ func (r *DRClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {
}

ctrl.Log.Info(fmt.Sprintf("DRCluster: Filtering DRPC (%s/%s)", drpc.Name, drpc.Namespace))

return filterDRPC(drpc)
}))

Expand All @@ -97,7 +96,6 @@ func (r *DRClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {
}

ctrl.Log.Info(fmt.Sprintf("DRCluster: Filtering ManifestWork (%s/%s)", mw.Name, mw.Namespace))

return filterDRClusterMW(mw)
}))

Expand All @@ -110,7 +108,6 @@ func (r *DRClusterReconciler) SetupWithManager(mgr ctrl.Manager) error {
}

ctrl.Log.Info(fmt.Sprintf("DRCluster: Filtering MCV (%s/%s)", mcv.Name, mcv.Namespace))

return filterDRClusterMCV(mcv)
}))

Expand Down Expand Up @@ -180,7 +177,6 @@ func DRPCUpdateOfInterest(oldDRPC, newDRPC *ramen.DRPlacementControl) bool {
log.Info("Processing DRPC failover cluster change event",
"name", newDRPC.GetName(),
"namespace", newDRPC.GetNamespace())

return true
}

Expand All @@ -193,14 +189,12 @@ func DRPCUpdateOfInterest(oldDRPC, newDRPC *ramen.DRPlacementControl) bool {
log.Info("Processing DRPC failed over event",
"name", newDRPC.GetName(),
"namespace", newDRPC.GetNamespace())

return true
}

log.Info("Ignoring DRPC failed over event",
"name", newDRPC.GetName(),
"namespace", newDRPC.GetNamespace())

return false
}

Expand Down Expand Up @@ -509,17 +503,14 @@ func (u *drclusterInstance) statusUpdate() error {
if err := u.client.Status().Update(u.ctx, u.object); err != nil {
u.log.Info(fmt.Sprintf("Failed to update drCluster status (%s/%s/%v)",
u.object.Name, u.object.Namespace, err))

return fmt.Errorf("failed to update drCluster status (%s/%s)", u.object.Name, u.object.Namespace)
}

u.log.Info(fmt.Sprintf("Updated drCluster Status %+v", u.object.Status))

return nil
}

u.log.Info(fmt.Sprintf("Nothing to update %+v", u.object.Status))

return nil
}

Expand Down Expand Up @@ -647,7 +638,6 @@ func (u *drclusterInstance) clusterUnfence() (bool, error) {

if requeue {
u.log.Info("requing as cluster unfence operation is not complete")

return requeue, nil
}

Expand Down Expand Up @@ -710,7 +700,6 @@ func (u *drclusterInstance) fenceClusterOnCluster(peerCluster *ramen.DRCluster)
"fencing operation not successful")

u.log.Info("Fencing operation not successful", "cluster", u.object.Name)

return true, fmt.Errorf("fencing operation result not successful")
}

Expand Down Expand Up @@ -776,7 +765,6 @@ func (u *drclusterInstance) unfenceClusterOnCluster(peerCluster *ramen.DRCluster
"unfencing operation not successful")

u.log.Info("Unfencing operation not successful", "cluster", u.object.Name)

return true, fmt.Errorf("un operation result not successful")
}

Expand Down Expand Up @@ -1241,7 +1229,6 @@ func (u *drclusterInstance) createNFManifestWork(targetCluster *ramen.DRCluster,
u.object.Name, u.object.Namespace,
peerCluster.Name, nf, annotations); err != nil {
log.Error(err, "failed to create or update NetworkFence manifest")

return fmt.Errorf("failed to create or update NetworkFence manifest in cluster %s to fence off cluster %s (%w)",
peerCluster.Name, targetCluster.Name, err)
}
Expand Down
1 change: 0 additions & 1 deletion controllers/drcluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,6 @@ func updateDRClusterManifestWorkStatus(clusterNamespace string) {

Eventually(func() bool {
err := apiReader.Get(context.TODO(), manifestLookupKey, mw)

return err == nil
}, timeout, interval).Should(BeTrue(),
fmt.Sprintf("failed to get manifest for DRCluster %s", clusterNamespace))
Expand Down

0 comments on commit c0977b5

Please sign in to comment.