From 4b0bd339ace40b22c14aac78f22e36d5540c2313 Mon Sep 17 00:00:00 2001 From: Jonathan Innis Date: Thu, 14 Nov 2024 01:11:19 -0800 Subject: [PATCH] Fix error checking ordering for DescribeInstances --- 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)