Skip to content

Commit 5be9c1e

Browse files
author
Ariel Kass
committed
another attempt to reresolve linter issues
Signed-off-by: Ariel Kass <[email protected]>
1 parent 3ca42fd commit 5be9c1e

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

controllers/pvc_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ func createFakeVolumeReplicationReconciler(t *testing.T, obj ...runtime.Object)
111111

112112
func TestGetVolumeHandle(t *testing.T) {
113113
t.Parallel()
114+
114115
testcases := []struct {
115116
name string
116117
pv *corev1.PersistentVolume

controllers/volumereplication_controller.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
186186

187187
return ctrl.Result{}, vgErr
188188
}
189+
189190
volumeHandle = vgc.Spec.Source.VolumeGroupHandle
190191
default:
191192
err = fmt.Errorf("unsupported datasource kind")
@@ -301,7 +302,6 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
301302

302303
var requeueForResync bool
303304

304-
305305
switch instance.Spec.ReplicationState {
306306
case replicationv1alpha1.Primary:
307307
replicationErr = r.markVolumeAsPrimary(instance, logger, replicationSource, replicationHandle, parameters, secret)
@@ -342,6 +342,7 @@ func (r *VolumeReplicationReconciler) Reconcile(ctx context.Context, req ctrl.Re
342342
replicationErr = fmt.Errorf("unsupported volume state")
343343
logger.Error(replicationErr, "given volume state is not supported", "ReplicationState", instance.Spec.ReplicationState)
344344
setFailureCondition(instance)
345+
345346
err = r.updateReplicationStatus(ctx, instance, logger, getCurrentReplicationState(instance), replicationErr.Error())
346347
if err != nil {
347348
logger.Error(err, "failed to update volumeReplication status", "VRName", instance.Name)
@@ -544,6 +545,7 @@ func (r *VolumeReplicationReconciler) markVolumeAsPrimary(volumeReplicationObjec
544545
logger.Info("force promoting volume due to known grpc error", "error", resp.Error)
545546

546547
volumeReplication.Force = true
548+
547549
resp := volumeReplication.Promote()
548550
if resp.Error != nil {
549551
logger.Error(resp.Error, "failed to force promote volume")
@@ -614,6 +616,7 @@ func (r *VolumeReplicationReconciler) resyncVolume(volumeReplicationObject *repl
614616

615617
return false, resp.Error
616618
}
619+
617620
resyncResponse, ok := resp.Response.(*replicationlib.ResyncVolumeResponse)
618621
if !ok {
619622
err := fmt.Errorf("received response of unexpected type")

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ func init() {
6464
func main() {
6565
var metricsAddr string
6666
var leaderElectionNamespace string
67-
var enableLeaderElection bool
6867
var probeAddr string
68+
69+
var enableLeaderElection bool
70+
6971
var opts zap.Options
7072

7173
if strings.EqualFold(os.Getenv("DEVELOPMENT_MODE"), "true") {

pkg/client/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ func connect(address string, timeout time.Duration) (*grpc.ClientConn, error) {
4242

4343
// New creates and returns the GRPC client.
4444
func New(address string, timeout time.Duration) (*Client, error) {
45-
c := &Client{}
46-
cc, err := connect(address, timeout)
45+
client := &Client{}
46+
connection, err := connect(address, timeout)
4747
if err != nil {
48-
return c, err
48+
return client, err
4949
}
50-
c.Client = cc
50+
c.Client = connection
5151
c.Timeout = timeout
5252

5353
return c, nil

0 commit comments

Comments
 (0)