Skip to content

Commit c036b28

Browse files
committed
Address review comments
1 parent 9d71fef commit c036b28

File tree

11 files changed

+173
-270
lines changed

11 files changed

+173
-270
lines changed

exp/api/v1beta2/awsmachinepool_webhook.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ limitations under the License.
1717
package v1beta2
1818

1919
import (
20-
"fmt"
2120
"time"
2221

2322
apierrors "k8s.io/apimachinery/pkg/api/errors"
@@ -166,33 +165,6 @@ func (r *AWSMachinePool) validateLifecycleHooks() field.ErrorList {
166165
return validateLifecycleHooks(r.Spec.AWSLifecycleHooks)
167166
}
168167

169-
func validateLifecycleHooks(hooks []AWSLifecycleHook) field.ErrorList {
170-
var allErrs field.ErrorList
171-
172-
for _, hook := range hooks {
173-
if hook.Name == "" {
174-
allErrs = append(allErrs, field.Required(field.NewPath("spec.lifecycleHooks.name"), "Name is required"))
175-
}
176-
if hook.NotificationTargetARN != nil && hook.RoleARN == nil {
177-
allErrs = append(allErrs, field.Required(field.NewPath("spec.lifecycleHooks.roleARN"), "RoleARN is required if NotificationTargetARN is provided"))
178-
}
179-
if hook.RoleARN != nil && hook.NotificationTargetARN == nil {
180-
allErrs = append(allErrs, field.Required(field.NewPath("spec.lifecycleHooks.notificationTargetARN"), "NotificationTargetARN is required if RoleARN is provided"))
181-
}
182-
if hook.LifecycleTransition != LifecycleTransitionInstanceLaunch && hook.LifecycleTransition != LifecycleTransitionInstanceTerminate {
183-
allErrs = append(allErrs, field.Invalid(field.NewPath("spec.lifecycleHooks.lifecycleTransition"), hook.LifecycleTransition, fmt.Sprintf("LifecycleTransition must be either %q or %q", LifecycleTransitionInstanceLaunch, LifecycleTransitionInstanceTerminate)))
184-
}
185-
if hook.DefaultResult != nil && (*hook.DefaultResult != DefaultResultContinue && *hook.DefaultResult != DefaultResultAbandon) {
186-
allErrs = append(allErrs, field.Invalid(field.NewPath("spec.lifecycleHooks.defaultResult"), *hook.DefaultResult, "DefaultResult must be either CONTINUE or ABANDON"))
187-
}
188-
if hook.HeartbeatTimeout != nil && (hook.HeartbeatTimeout.Seconds() < float64(30) || hook.HeartbeatTimeout.Seconds() > float64(172800)) {
189-
allErrs = append(allErrs, field.Invalid(field.NewPath("spec.lifecycleHooks.heartbeatTimeout"), *hook.HeartbeatTimeout, "HeartbeatTimeout must be between 30 and 172800 seconds"))
190-
}
191-
}
192-
193-
return allErrs
194-
}
195-
196168
// ValidateCreate will do any extra validation when creating a AWSMachinePool.
197169
func (r *AWSMachinePool) ValidateCreate() (admission.Warnings, error) {
198170
log.Info("AWSMachinePool validate create", "machine-pool", klog.KObj(r))

exp/api/v1beta2/conditions_consts.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ const (
5757

5858
// LifecycleHookReadyCondition reports on the status of the lifecycle hook.
5959
LifecycleHookReadyCondition clusterv1.ConditionType = "LifecycleHookReady"
60-
// LifecycleHookNotFoundReason used when the lifecycle hook couldn't be retrieved.
61-
LifecycleHookNotFoundReason = "LifecycleHookNotFound"
6260
// LifecycleHookCreationFailedReason used for failures during lifecycle hook creation.
6361
LifecycleHookCreationFailedReason = "LifecycleHookCreationFailed"
6462
// LifecycleHookUpdateFailedReason used for failures during lifecycle hook update.

exp/api/v1beta2/types.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ type AWSLifecycleHook struct {
251251
// +optional
252252
// +kubebuilder:validation:Enum=CONTINUE;ABANDON
253253
// +kubebuilder:validation:default:=none
254-
DefaultResult *DefaultResult `json:"defaultResult,omitempty"`
254+
DefaultResult *LifecycleHookDefaultResult `json:"defaultResult,omitempty"`
255255

256256
// Contains additional metadata that will be passed to the notification target.
257257
// +optional
@@ -262,27 +262,27 @@ type AWSLifecycleHook struct {
262262
type LifecycleTransition string
263263

264264
const (
265-
// LifecycleTransitionInstanceLaunch is the launching state of the EC2 instance.
266-
LifecycleTransitionInstanceLaunch LifecycleTransition = "autoscaling:EC2_INSTANCE_LAUNCHING"
267-
// LifecycleTransitionInstanceTerminate is the terminating state of the EC2 instance.
268-
LifecycleTransitionInstanceTerminate LifecycleTransition = "autoscaling:EC2_INSTANCE_TERMINATING"
265+
// LifecycleHookTransitionInstanceLaunching is the launching state of the EC2 instance.
266+
LifecycleHookTransitionInstanceLaunching LifecycleTransition = "autoscaling:EC2_INSTANCE_LAUNCHING"
267+
// LifecycleHookTransitionInstanceTerminating is the terminating state of the EC2 instance.
268+
LifecycleHookTransitionInstanceTerminating LifecycleTransition = "autoscaling:EC2_INSTANCE_TERMINATING"
269269
)
270270

271271
func (l *LifecycleTransition) String() string {
272272
return string(*l)
273273
}
274274

275-
// DefaultResult is the default result for the lifecycle hook.
276-
type DefaultResult string
275+
// LifecycleHookDefaultResult is the default result for the lifecycle hook.
276+
type LifecycleHookDefaultResult string
277277

278278
const (
279-
// DefaultResultContinue is the default result for the lifecycle hook to continue.
280-
DefaultResultContinue DefaultResult = "CONTINUE"
281-
// DefaultResultAbandon is the default result for the lifecycle hook to abandon.
282-
DefaultResultAbandon DefaultResult = "ABANDON"
279+
// LifecycleHookDefaultResultContinue is the default result for the lifecycle hook to continue.
280+
LifecycleHookDefaultResultContinue LifecycleHookDefaultResult = "CONTINUE"
281+
// LifecycleHookDefaultResultAbandon is the default result for the lifecycle hook to abandon.
282+
LifecycleHookDefaultResultAbandon LifecycleHookDefaultResult = "ABANDON"
283283
)
284284

285-
func (d *DefaultResult) String() string {
285+
func (d *LifecycleHookDefaultResult) String() string {
286286
return string(*d)
287287
}
288288

exp/api/v1beta2/validation.go

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
Copyright 2024 The Kubernetes Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
package v1beta2
18+
19+
import (
20+
"fmt"
21+
22+
"k8s.io/apimachinery/pkg/util/validation/field"
23+
)
24+
25+
func validateLifecycleHooks(hooks []AWSLifecycleHook) field.ErrorList {
26+
var allErrs field.ErrorList
27+
28+
for _, hook := range hooks {
29+
if hook.Name == "" {
30+
allErrs = append(allErrs, field.Required(field.NewPath("spec.lifecycleHooks.name"), "Name is required"))
31+
}
32+
if hook.NotificationTargetARN != nil && hook.RoleARN == nil {
33+
allErrs = append(allErrs, field.Required(field.NewPath("spec.lifecycleHooks.roleARN"), "RoleARN is required if NotificationTargetARN is provided"))
34+
}
35+
if hook.RoleARN != nil && hook.NotificationTargetARN == nil {
36+
allErrs = append(allErrs, field.Required(field.NewPath("spec.lifecycleHooks.notificationTargetARN"), "NotificationTargetARN is required if RoleARN is provided"))
37+
}
38+
if hook.LifecycleTransition != LifecycleHookTransitionInstanceLaunching && hook.LifecycleTransition != LifecycleHookTransitionInstanceTerminating {
39+
allErrs = append(allErrs, field.Invalid(field.NewPath("spec.lifecycleHooks.lifecycleTransition"), hook.LifecycleTransition, fmt.Sprintf("LifecycleTransition must be either %q or %q", LifecycleHookTransitionInstanceLaunching, LifecycleHookTransitionInstanceTerminating)))
40+
}
41+
if hook.DefaultResult != nil && (*hook.DefaultResult != LifecycleHookDefaultResultContinue && *hook.DefaultResult != LifecycleHookDefaultResultAbandon) {
42+
allErrs = append(allErrs, field.Invalid(field.NewPath("spec.lifecycleHooks.defaultResult"), *hook.DefaultResult, fmt.Sprintf("DefaultResult must be either %s or %s", LifecycleHookDefaultResultContinue, LifecycleHookDefaultResultAbandon)))
43+
}
44+
if hook.HeartbeatTimeout != nil && (hook.HeartbeatTimeout.Seconds() < float64(30) || hook.HeartbeatTimeout.Seconds() > float64(172800)) {
45+
allErrs = append(allErrs, field.Invalid(field.NewPath("spec.lifecycleHooks.heartbeatTimeout"), *hook.HeartbeatTimeout, "HeartbeatTimeout must be between 30 and 172800 seconds"))
46+
}
47+
}
48+
49+
return allErrs
50+
}

exp/api/v1beta2/zz_generated.deepcopy.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

exp/controllers/awsmachinepool_controller.go

Lines changed: 6 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ func (r *AWSMachinePoolReconciler) reconcileNormal(ctx context.Context, machineP
298298
return nil
299299
}
300300

301-
if err := r.ReconcileLifecycleHooks(*machinePoolScope, asgsvc); err != nil {
302-
r.Recorder.Eventf(machinePoolScope.AWSMachinePool, corev1.EventTypeWarning, "FaileLifecycleHooksReconcile", "Failed to reconcile lifecycle hooks: %v", err)
301+
if err := r.reconcileLifecycleHooks(machinePoolScope, asgsvc); err != nil {
302+
r.Recorder.Eventf(machinePoolScope.AWSMachinePool, corev1.EventTypeWarning, "FailedLifecycleHooksReconcile", "Failed to reconcile lifecycle hooks: %v", err)
303303
return errors.Wrap(err, "failed to reconcile lifecycle hooks")
304304
}
305305

@@ -612,70 +612,11 @@ func machinePoolToInfrastructureMapFunc(gvk schema.GroupVersionKind) handler.Map
612612
}
613613
}
614614

615-
// ReconcileLifecycleHooks periodically reconciles a lifecycle hook for the ASG.
616-
func (r *AWSMachinePoolReconciler) ReconcileLifecycleHooks(scope scope.MachinePoolScope, asgsvc services.ASGInterface) error {
617-
lifecyleHooks := scope.GetLifecycleHooks()
618-
for i := range lifecyleHooks {
619-
if err := r.reconcileLifecycleHook(scope, &lifecyleHooks[i], asgsvc); err != nil {
620-
return err
621-
}
622-
}
623-
624-
// Get a list of lifecycle hooks that are registered with the ASG but not defined in the MachinePool and delete them.
625-
hooks, err := asgsvc.DescribeLifecycleHooks(scope.Name())
626-
if err != nil {
627-
return err
628-
}
629-
for _, hook := range hooks {
630-
found := false
631-
for _, definedHook := range scope.GetLifecycleHooks() {
632-
if hook.Name == definedHook.Name {
633-
found = true
634-
break
635-
}
636-
}
637-
if !found {
638-
scope.Info("Deleting lifecycle hook", "hook", hook.Name)
639-
if err := asgsvc.DeleteLifecycleHook(scope.Name(), hook); err != nil {
640-
conditions.MarkFalse(scope.GetMachinePool(), expinfrav1.LifecycleHookReadyCondition, expinfrav1.LifecycleHookDeletionFailedReason, clusterv1.ConditionSeverityError, err.Error())
641-
return err
642-
}
643-
}
644-
}
645-
646-
return nil
647-
}
648-
649-
func (r *AWSMachinePoolReconciler) reconcileLifecycleHook(scope scope.MachinePoolScope, hook *expinfrav1.AWSLifecycleHook, asgsvc services.ASGInterface) error {
650-
scope.Info("Checking for existing lifecycle hook")
651-
existingHook, err := asgsvc.DescribeLifecycleHook(scope.Name(), hook)
652-
if err != nil {
653-
conditions.MarkUnknown(scope.GetMachinePool(), expinfrav1.LifecycleHookReadyCondition, expinfrav1.LifecycleHookNotFoundReason, err.Error())
654-
return err
655-
}
656-
657-
if existingHook == nil {
658-
scope.Info("Creating lifecycle hook")
659-
if err := asgsvc.CreateLifecycleHook(scope.Name(), hook); err != nil {
660-
conditions.MarkFalse(scope.GetMachinePool(), expinfrav1.LifecycleHookReadyCondition, expinfrav1.LifecycleHookCreationFailedReason, clusterv1.ConditionSeverityError, err.Error())
661-
return err
662-
}
663-
return nil
664-
}
665-
666-
// If the lifecycle hook exists, we need to check if it's up to date
667-
needsUpdate := asgsvc.LifecycleHookNeedsUpdate(existingHook, hook)
668-
669-
if needsUpdate {
670-
scope.Info("Updating lifecycle hook")
671-
if err := asgsvc.UpdateLifecycleHook(scope.Name(), hook); err != nil {
672-
conditions.MarkFalse(scope.GetMachinePool(), expinfrav1.LifecycleHookReadyCondition, expinfrav1.LifecycleHookUpdateFailedReason, clusterv1.ConditionSeverityError, err.Error())
673-
return err
674-
}
675-
}
615+
// reconcileLifecycleHooks periodically reconciles a lifecycle hook for the ASG.
616+
func (r *AWSMachinePoolReconciler) reconcileLifecycleHooks(machinePoolScope *scope.MachinePoolScope, asgsvc services.ASGInterface) error {
617+
asgName := machinePoolScope.Name()
676618

677-
conditions.MarkTrue(scope.GetMachinePool(), expinfrav1.LifecycleHookReadyCondition)
678-
return nil
619+
return asg.ReconcileLifecycleHooks(asgsvc, asgName, machinePoolScope.GetLifecycleHooks(), map[string]bool{}, machinePoolScope.GetMachinePool(), machinePoolScope)
679620
}
680621

681622
func (r *AWSMachinePoolReconciler) getInfraCluster(ctx context.Context, log *logger.Logger, cluster *clusterv1.Cluster, awsMachinePool *expinfrav1.AWSMachinePool) (scope.EC2Scope, error) {

exp/controllers/awsmachinepool_controller_test.go

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
545545
MixedInstancesPolicy: awsMachinePool.Spec.MixedInstancesPolicy.DeepCopy(),
546546
}, nil
547547
})
548-
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil).AnyTimes()
548+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil)
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)
@@ -825,8 +825,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
825825
ms.AWSMachinePool.Spec.AWSLifecycleHooks = append(ms.AWSMachinePool.Spec.AWSLifecycleHooks, newLifecycleHook)
826826

827827
reconSvc.EXPECT().ReconcileLaunchTemplate(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
828-
asgSvc.EXPECT().DescribeLifecycleHooks(ms.Name()).Return(nil, nil)
829-
asgSvc.EXPECT().DescribeLifecycleHook(ms.Name(), &newLifecycleHook).Return(nil, nil)
828+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Eq(ms.Name())).Return(nil, nil)
830829
asgSvc.EXPECT().CreateLifecycleHook(ms.Name(), &newLifecycleHook).Return(nil)
831830
reconSvc.EXPECT().ReconcileTags(gomock.Any(), gomock.Any()).Return(nil)
832831
asgSvc.EXPECT().GetASGByName(gomock.Any()).DoAndReturn(func(scope *scope.MachinePoolScope) (*expinfrav1.AutoScalingGroup, error) {
@@ -843,7 +842,6 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
843842
MixedInstancesPolicy: awsMachinePool.Spec.MixedInstancesPolicy.DeepCopy(),
844843
}, nil
845844
})
846-
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil).AnyTimes()
847845
asgSvc.EXPECT().SubnetIDs(gomock.Any()).Return([]string{"subnet-1"}, nil) // no change
848846
// No changes, so there must not be an ASG update!
849847
asgSvc.EXPECT().UpdateASG(gomock.Any()).Times(0)
@@ -857,7 +855,7 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
857855
defer teardown(t, g)
858856

859857
reconSvc.EXPECT().ReconcileLaunchTemplate(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
860-
asgSvc.EXPECT().DescribeLifecycleHooks(ms.Name()).Return([]*expinfrav1.AWSLifecycleHook{
858+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Eq(ms.Name())).Return([]*expinfrav1.AWSLifecycleHook{
861859
{
862860
Name: "hook-to-remove",
863861
LifecycleTransition: "autoscaling:EC2_INSTANCE_LAUNCHING",
@@ -882,7 +880,6 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
882880
MixedInstancesPolicy: awsMachinePool.Spec.MixedInstancesPolicy.DeepCopy(),
883881
}, nil
884882
})
885-
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil).AnyTimes()
886883
asgSvc.EXPECT().SubnetIDs(gomock.Any()).Return([]string{"subnet-1"}, nil) // no change
887884
// No changes, so there must not be an ASG update!
888885
asgSvc.EXPECT().UpdateASG(gomock.Any()).Times(0)
@@ -901,18 +898,13 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
901898
ms.AWSMachinePool.Spec.AWSLifecycleHooks = append(ms.AWSMachinePool.Spec.AWSLifecycleHooks, newLifecycleHook)
902899

903900
reconSvc.EXPECT().ReconcileLaunchTemplate(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
904-
asgSvc.EXPECT().DescribeLifecycleHook(ms.Name(), &newLifecycleHook).Return(nil, nil)
905-
asgSvc.EXPECT().CreateLifecycleHook(ms.Name(), &newLifecycleHook).Return(nil)
906-
asgSvc.EXPECT().DescribeLifecycleHooks(ms.Name()).Return([]*expinfrav1.AWSLifecycleHook{
907-
{
908-
Name: "new-hook",
909-
LifecycleTransition: "autoscaling:EC2_INSTANCE_LAUNCHING",
910-
},
901+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Eq(ms.Name())).Return([]*expinfrav1.AWSLifecycleHook{
911902
{
912903
Name: "hook-to-remove",
913904
LifecycleTransition: "autoscaling:EC2_INSTANCE_LAUNCHING",
914905
},
915906
}, nil)
907+
asgSvc.EXPECT().CreateLifecycleHook(ms.Name(), &newLifecycleHook).Return(nil)
916908
asgSvc.EXPECT().DeleteLifecycleHook(ms.Name(), &expinfrav1.AWSLifecycleHook{
917909
Name: "hook-to-remove",
918910
LifecycleTransition: "autoscaling:EC2_INSTANCE_LAUNCHING",
@@ -932,7 +924,6 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
932924
MixedInstancesPolicy: awsMachinePool.Spec.MixedInstancesPolicy.DeepCopy(),
933925
}, nil
934926
})
935-
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil).AnyTimes()
936927
asgSvc.EXPECT().SubnetIDs(gomock.Any()).Return([]string{"subnet-1"}, nil) // no change
937928
// No changes, so there must not be an ASG update!
938929
asgSvc.EXPECT().UpdateASG(gomock.Any()).Times(0)
@@ -951,21 +942,13 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
951942
ms.AWSMachinePool.Spec.AWSLifecycleHooks = append(ms.AWSMachinePool.Spec.AWSLifecycleHooks, updateLifecycleHook)
952943

953944
reconSvc.EXPECT().ReconcileLaunchTemplate(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil)
954-
asgSvc.EXPECT().DescribeLifecycleHook(ms.Name(), &updateLifecycleHook).Return(&expinfrav1.AWSLifecycleHook{
955-
Name: "hook-to-update",
956-
LifecycleTransition: "autoscaling:EC2_INSTANCE_LAUNCHING",
957-
}, nil)
958-
asgSvc.EXPECT().LifecycleHookNeedsUpdate(&expinfrav1.AWSLifecycleHook{
959-
Name: "hook-to-update",
960-
LifecycleTransition: "autoscaling:EC2_INSTANCE_LAUNCHING",
961-
}, &updateLifecycleHook).Return(true)
962-
asgSvc.EXPECT().UpdateLifecycleHook(ms.Name(), &updateLifecycleHook).Return(nil)
963-
asgSvc.EXPECT().DescribeLifecycleHooks(ms.Name()).Return([]*expinfrav1.AWSLifecycleHook{
945+
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Eq(ms.Name())).Return([]*expinfrav1.AWSLifecycleHook{
964946
{
965947
Name: "hook-to-update",
966948
LifecycleTransition: "autoscaling:EC2_INSTANCE_LAUNCHING",
967949
},
968950
}, nil)
951+
asgSvc.EXPECT().UpdateLifecycleHook(ms.Name(), &updateLifecycleHook).Return(nil)
969952
reconSvc.EXPECT().ReconcileTags(gomock.Any(), gomock.Any()).Return(nil)
970953
asgSvc.EXPECT().GetASGByName(gomock.Any()).DoAndReturn(func(scope *scope.MachinePoolScope) (*expinfrav1.AutoScalingGroup, error) {
971954
g.Expect(scope.Name()).To(Equal("test"))
@@ -981,7 +964,6 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
981964
MixedInstancesPolicy: awsMachinePool.Spec.MixedInstancesPolicy.DeepCopy(),
982965
}, nil
983966
})
984-
asgSvc.EXPECT().DescribeLifecycleHooks(gomock.Any()).Return(nil, nil).AnyTimes()
985967
asgSvc.EXPECT().SubnetIDs(gomock.Any()).Return([]string{"subnet-1"}, nil) // no change
986968
// No changes, so there must not be an ASG update!
987969
asgSvc.EXPECT().UpdateASG(gomock.Any()).Times(0)
@@ -992,7 +974,6 @@ func TestAWSMachinePoolReconciler(t *testing.T) {
992974
})
993975
}
994976

995-
// TODO: This was taken from awsmachine_controller_test, i think it should be moved to elsewhere in both locations like test/helpers.
996977
type conditionAssertion struct {
997978
conditionType clusterv1.ConditionType
998979
status corev1.ConditionStatus

0 commit comments

Comments
 (0)