Skip to content

Commit 95ba583

Browse files
committed
fix: tests
1 parent b62a84d commit 95ba583

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

exp/controllers/awsmachinepool_controller_test.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
324324
setSuspendedProcesses(t, g)
325325
ms.AWSMachinePool.Spec.SuspendProcesses.All = true
326326
reconSvc.EXPECT().ReconcileLaunchTemplate(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
327-
reconSvc.EXPECT().ReconcileLifecycleHooks(gomock.Any(), asgSvc).Return(nil)
327+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil)
328328
reconSvc.EXPECT().ReconcileTags(gomock.Any(), gomock.Any()).Return(nil)
329329
asgSvc.EXPECT().GetASGByName(gomock.Any()).Return(&expinfrav1.AutoScalingGroup{
330330
Name: "name",
@@ -365,7 +365,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
365365
setSuspendedProcesses(t, g)
366366

367367
reconSvc.EXPECT().ReconcileLaunchTemplate(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
368-
reconSvc.EXPECT().ReconcileLifecycleHooks(gomock.Any(), asgSvc).Return(nil)
368+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil)
369369
reconSvc.EXPECT().ReconcileTags(gomock.Any(), gomock.Any()).Return(nil)
370370
asgSvc.EXPECT().GetASGByName(gomock.Any()).Return(&expinfrav1.AutoScalingGroup{
371371
Name: "name",
@@ -391,7 +391,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
391391
DesiredCapacity: ptr.To[int32](1),
392392
}
393393
reconSvc.EXPECT().ReconcileLaunchTemplate(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
394-
reconSvc.EXPECT().ReconcileLifecycleHooks(gomock.Any(), asgSvc).Return(nil)
394+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil)
395395
asgSvc.EXPECT().GetASGByName(gomock.Any()).Return(&asg, nil)
396396
asgSvc.EXPECT().SubnetIDs(gomock.Any()).Return([]string{}, nil)
397397
asgSvc.EXPECT().UpdateASG(gomock.Any()).Return(nil)
@@ -431,7 +431,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
431431
Subnets: []string{"subnet1", "subnet2"},
432432
}
433433
reconSvc.EXPECT().ReconcileLaunchTemplate(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
434-
reconSvc.EXPECT().ReconcileLifecycleHooks(gomock.Any(), asgSvc).Return(nil)
434+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil)
435435
reconSvc.EXPECT().ReconcileTags(gomock.Any(), gomock.Any()).Return(nil)
436436
asgSvc.EXPECT().GetASGByName(gomock.Any()).Return(&asg, nil).AnyTimes()
437437
asgSvc.EXPECT().SubnetIDs(gomock.Any()).Return([]string{"subnet2", "subnet1"}, nil).Times(1)
@@ -451,7 +451,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
451451
Subnets: []string{"subnet1", "subnet2"},
452452
}
453453
reconSvc.EXPECT().ReconcileLaunchTemplate(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
454-
reconSvc.EXPECT().ReconcileLifecycleHooks(gomock.Any(), asgSvc).Return(nil)
454+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil)
455455
reconSvc.EXPECT().ReconcileTags(gomock.Any(), gomock.Any()).Return(nil)
456456
asgSvc.EXPECT().GetASGByName(gomock.Any()).Return(&asg, nil).AnyTimes()
457457
asgSvc.EXPECT().SubnetIDs(gomock.Any()).Return([]string{"subnet1"}, nil).Times(1)
@@ -471,7 +471,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
471471
Subnets: []string{},
472472
}
473473
reconSvc.EXPECT().ReconcileLaunchTemplate(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
474-
reconSvc.EXPECT().ReconcileLifecycleHooks(gomock.Any(), asgSvc).Return(nil)
474+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil)
475475
reconSvc.EXPECT().ReconcileTags(gomock.Any(), gomock.Any()).Return(nil)
476476
asgSvc.EXPECT().GetASGByName(gomock.Any()).Return(&asg, nil).AnyTimes()
477477
asgSvc.EXPECT().SubnetIDs(gomock.Any()).Return([]string{}, nil).Times(1)
@@ -545,7 +545,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
545545
MixedInstancesPolicy: awsMachinePool.Spec.MixedInstancesPolicy.DeepCopy(),
546546
}, nil
547547
})
548-
asgSvc.EXPECT().GetLifecycleHooks(gomock.Any()).Return(nil, nil).AnyTimes()
548+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil).AnyTimes()
549549
asgSvc.EXPECT().SubnetIDs(gomock.Any()).Return([]string{"subnet-1"}, nil) // no change
550550
// No changes, so there must not be an ASG update!
551551
asgSvc.EXPECT().UpdateASG(gomock.Any()).Times(0)
@@ -599,7 +599,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
599599
MixedInstancesPolicy: awsMachinePool.Spec.MixedInstancesPolicy.DeepCopy(),
600600
}, nil
601601
})
602-
asgSvc.EXPECT().GetLifecycleHooks(gomock.Any())
602+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any())
603603
asgSvc.EXPECT().SubnetIDs(gomock.Any()).Return([]string{"subnet-1"}, nil) // no change
604604
// No changes, so there must not be an ASG update!
605605
asgSvc.EXPECT().UpdateASG(gomock.Any()).Times(0)
@@ -656,7 +656,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
656656
MixedInstancesPolicy: awsMachinePool.Spec.MixedInstancesPolicy.DeepCopy(),
657657
}, nil
658658
})
659-
asgSvc.EXPECT().GetLifecycleHooks(gomock.Any())
659+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any())
660660
asgSvc.EXPECT().SubnetIDs(gomock.Any()).Return([]string{"subnet-1"}, nil) // no change
661661
// No changes, so there must not be an ASG update!
662662
asgSvc.EXPECT().UpdateASG(gomock.Any()).Times(0)
@@ -741,7 +741,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
741741
MixedInstancesPolicy: awsMachinePool.Spec.MixedInstancesPolicy.DeepCopy(),
742742
}, nil
743743
})
744-
asgSvc.EXPECT().GetLifecycleHooks(gomock.Any())
744+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any())
745745
asgSvc.EXPECT().SubnetIDs(gomock.Any()).Return([]string{"subnet-1"}, nil) // no change
746746
// No changes, so there must not be an ASG update!
747747
asgSvc.EXPECT().UpdateASG(gomock.Any()).Times(0)

0 commit comments

Comments
 (0)