Skip to content

Commit a14d407

Browse files
committed
fix: multiple return values
1 parent fb0bbd4 commit a14d407

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

exp/controllers/awsmachinepool_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ func (r *AWSMachinePoolReconciler) reconcileNormal(ctx context.Context, machineP
355355

356356
if err := r.reconcileLifecycleHooks(ctx, machinePoolScope, asgsvc); err != nil {
357357
r.Recorder.Eventf(machinePoolScope.AWSMachinePool, corev1.EventTypeWarning, "FailedLifecycleHooksReconcile", "Failed to reconcile lifecycle hooks: %v", err)
358-
return errors.Wrap(err, "failed to reconcile lifecycle hooks")
358+
return ctrl.Result{}, errors.Wrap(err, "failed to reconcile lifecycle hooks")
359359
}
360360

361361
if annotations.ReplicasManagedByExternalAutoscaler(machinePoolScope.MachinePool) {

exp/controllers/awsmachinepool_controller_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
189189
return reconSvc
190190
},
191191
Recorder: recorder,
192-
Client: testEnv.Client,
193192
}
194193
}
195194

@@ -1030,7 +1029,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
10301029
Name: "name",
10311030
}, nil)
10321031

1033-
err := reconciler.reconcileNormal(context.Background(), ms, cs, cs)
1032+
_, err := reconciler.reconcileNormal(context.Background(), ms, cs, cs)
10341033
g.Expect(err).To(Succeed())
10351034
})
10361035
t.Run("New lifecycle hook is added", func(t *testing.T) {
@@ -1066,7 +1065,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
10661065
// No changes, so there must not be an ASG update!
10671066
asgSvc.EXPECT().UpdateASG(gomock.Any()).Times(0)
10681067

1069-
err := reconciler.reconcileNormal(context.Background(), ms, cs, cs)
1068+
_, err := reconciler.reconcileNormal(context.Background(), ms, cs, cs)
10701069
g.Expect(err).To(Succeed())
10711070
})
10721071
t.Run("Lifecycle hook to remove", func(t *testing.T) {
@@ -1104,7 +1103,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
11041103
// No changes, so there must not be an ASG update!
11051104
asgSvc.EXPECT().UpdateASG(gomock.Any()).Times(0)
11061105

1107-
err := reconciler.reconcileNormal(context.Background(), ms, cs, cs)
1106+
_, err := reconciler.reconcileNormal(context.Background(), ms, cs, cs)
11081107
g.Expect(err).To(Succeed())
11091108
})
11101109
t.Run("One to add, one to remove", func(t *testing.T) {
@@ -1148,7 +1147,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
11481147
// No changes, so there must not be an ASG update!
11491148
asgSvc.EXPECT().UpdateASG(gomock.Any()).Times(0)
11501149

1151-
err := reconciler.reconcileNormal(context.Background(), ms, cs, cs)
1150+
_, err := reconciler.reconcileNormal(context.Background(), ms, cs, cs)
11521151
g.Expect(err).To(Succeed())
11531152
})
11541153
t.Run("Update hook", func(t *testing.T) {
@@ -1188,7 +1187,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
11881187
// No changes, so there must not be an ASG update!
11891188
asgSvc.EXPECT().UpdateASG(gomock.Any()).Times(0)
11901189

1191-
err := reconciler.reconcileNormal(context.Background(), ms, cs, cs)
1190+
_, err := reconciler.reconcileNormal(context.Background(), ms, cs, cs)
11921191
g.Expect(err).To(Succeed())
11931192
})
11941193
})

0 commit comments

Comments
 (0)