diff --git a/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go b/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go index d39f4685f63b..f15c778d9eee 100644 --- a/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go +++ b/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go @@ -479,7 +479,6 @@ func (m *asgCache) createPlaceholdersForDesiredNonStartedInstances(groups []*aut func (m *asgCache) isNodeGroupAvailable(group *autoscaling.Group) (bool, error) { input := &autoscaling.DescribeScalingActivitiesInput{ AutoScalingGroupName: group.AutoScalingGroupName, - MaxRecords: aws.Int64(1), // We only care about the most recent event } start := time.Now() @@ -496,6 +495,7 @@ func (m *asgCache) isNodeGroupAvailable(group *autoscaling.Group) (bool, error) if activity.StartTime.Before(lut) { break } else if *activity.StatusCode == "Failed" { + klog.Warningf("ASG %s scaling failed with %s", asgRef.Name, *activity) return false, nil } } else { diff --git a/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups_test.go b/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups_test.go index f619af1e2da6..c5078b03b5b7 100644 --- a/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups_test.go +++ b/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups_test.go @@ -128,7 +128,6 @@ func TestCreatePlaceholders(t *testing.T) { if shouldCallDescribeScalingActivities { a.On("DescribeScalingActivities", &autoscaling.DescribeScalingActivitiesInput{ AutoScalingGroupName: asgName, - MaxRecords: aws.Int64(1), }).Return( &autoscaling.DescribeScalingActivitiesOutput{Activities: tc.activities}, tc.describeErr, diff --git a/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go b/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go index 2753daabd2dc..e1d6a92a1ef9 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider_test.go @@ -466,7 +466,6 @@ func TestDeleteNodesWithPlaceholder(t *testing.T) { a.On("DescribeScalingActivities", &autoscaling.DescribeScalingActivitiesInput{ AutoScalingGroupName: aws.String("test-asg"), - MaxRecords: aws.Int64(1), }, ).Return(&autoscaling.DescribeScalingActivitiesOutput{}, nil) diff --git a/cluster-autoscaler/cloudprovider/aws/aws_manager_test.go b/cluster-autoscaler/cloudprovider/aws/aws_manager_test.go index 79d8a2d619a3..50df508f8df6 100644 --- a/cluster-autoscaler/cloudprovider/aws/aws_manager_test.go +++ b/cluster-autoscaler/cloudprovider/aws/aws_manager_test.go @@ -394,7 +394,6 @@ func TestFetchExplicitAsgs(t *testing.T) { a.On("DescribeScalingActivities", &autoscaling.DescribeScalingActivitiesInput{ AutoScalingGroupName: aws.String("coolasg"), - MaxRecords: aws.Int64(1), }, ).Return(&autoscaling.DescribeScalingActivitiesOutput{}, nil) @@ -559,7 +558,6 @@ func TestFetchAutoAsgs(t *testing.T) { a.On("DescribeScalingActivities", &autoscaling.DescribeScalingActivitiesInput{ AutoScalingGroupName: aws.String("coolasg"), - MaxRecords: aws.Int64(1), }, ).Return(&autoscaling.DescribeScalingActivitiesOutput{}, nil)