Skip to content

Commit

Permalink
log failure information
Browse files Browse the repository at this point in the history
  • Loading branch information
David Morrison committed Mar 3, 2022
1 parent 8d608ac commit ad93c8b
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 0 additions & 2 deletions cluster-autoscaler/cloudprovider/aws/aws_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit ad93c8b

Please sign in to comment.