Skip to content

Commit

Permalink
better error message when no ASG found for name
Browse files Browse the repository at this point in the history
  • Loading branch information
matt-deboer committed Aug 8, 2017
1 parent 90b8398 commit 776eabe
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/platform/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ func (a *AWS) getASGInstanceIDs(sess *session.Session, asgName string) ([]*strin
return nil, err
}

if resp.AutoScalingGroups == nil || len(resp.AutoScalingGroups) == 0 {
return nil, fmt.Errorf("No autoscaling groups were found matching the name '%s'", asgName)
}

instanceIDs := make([]*string, 0, len(resp.AutoScalingGroups[0].Instances))
for _, i := range resp.AutoScalingGroups[0].Instances {
instanceIDs = append(instanceIDs, i.InstanceId)
Expand Down

0 comments on commit 776eabe

Please sign in to comment.