mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +00:00
Merge pull request #106280 from nckturner/max-results
[AWS] Set max results if its not set
This commit is contained in:
commit
f5be5052e3
@ -960,6 +960,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 {
|
||||
|
Loading…
Reference in New Issue
Block a user