From 992689ceaae619c8b87fc347e8b6f634b2559af6 Mon Sep 17 00:00:00 2001 From: Jonathan Innis Date: Thu, 14 Nov 2024 01:20:53 -0800 Subject: [PATCH] fix: Fix error checking ordering for DescribeInstances (#7381) --- pkg/providers/instance/instance.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/providers/instance/instance.go b/pkg/providers/instance/instance.go index e4541906425d..45db942c331b 100644 --- a/pkg/providers/instance/instance.go +++ b/pkg/providers/instance/instance.go @@ -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, @@ -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)