Skip to content

Commit

Permalink
fix: Fix error checking ordering for DescribeInstances (#7381)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored Nov 14, 2024
1 parent 569c06d commit 992689c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/providers/instance/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ func (p *DefaultProvider) List(ctx context.Context) ([]*Instance, error) {
Values: []string{v1.NodeClassTagKey},
},
{
Name: aws.String(v1.EKSClusterNameTagKey),
Name: aws.String(fmt.Sprintf("tag:%s", v1.EKSClusterNameTagKey)),
Values: []string{options.FromContext(ctx).ClusterName},
},
instanceStateFilter,
Expand All @@ -166,10 +166,10 @@ func (p *DefaultProvider) List(ctx context.Context) ([]*Instance, error) {

for paginator.HasMorePages() {
page, err := paginator.NextPage(ctx)
out.Reservations = append(out.Reservations, page.Reservations...)
if err != nil {
return nil, fmt.Errorf("describing ec2 instances, %w", err)
}
out.Reservations = append(out.Reservations, page.Reservations...)
}
instances, err := instancesFromOutput(out)
return instances, cloudprovider.IgnoreNodeClaimNotFoundError(err)
Expand Down

0 comments on commit 992689c

Please sign in to comment.