Skip to content

Commit

Permalink
Merge pull request #107653 from nckturner/automated-cherry-pick-of-#1…
Browse files Browse the repository at this point in the history
…06280-upstream-release-1.21

Automated cherry pick of #106280: Set max results if its not set
  • Loading branch information
k8s-ci-robot committed Jan 28, 2022
2 parents df99d39 + 6972f63 commit b37aecf
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions staging/src/k8s.io/legacy-cloud-providers/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,13 @@ func (s *awsSdkEC2) DescribeInstances(request *ec2.DescribeInstancesInput) ([]*e
results := []*ec2.Instance{}
var nextToken *string
requestTime := time.Now()

if request.MaxResults == nil && request.InstanceIds == nil {
// MaxResults must be set in order for pagination to work
// MaxResults cannot be set with InstanceIds
request.MaxResults = aws.Int64(1000)
}

for {
response, err := s.ec2.DescribeInstances(request)
if err != nil {
Expand Down

0 comments on commit b37aecf

Please sign in to comment.