From 3bebfd5e0cba9b9cc13799cbea660f8d64209dd8 Mon Sep 17 00:00:00 2001 From: Jason Deal Date: Mon, 21 Oct 2024 21:31:09 -0700 Subject: [PATCH] fix(0.34.x): discover deprecated EKS optimized AMIs (#7244) --- pkg/providers/amifamily/ami.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/providers/amifamily/ami.go b/pkg/providers/amifamily/ami.go index 9f7b9a014faa..e122a04a8565 100644 --- a/pkg/providers/amifamily/ami.go +++ b/pkg/providers/amifamily/ami.go @@ -153,8 +153,9 @@ func (p *Provider) getDefaultAMIs(ctx context.Context, nodeClass *v1beta1.EC2Nod } // Resolve Name and CreationDate information into the DefaultAMIs if err = p.ec2api.DescribeImagesPagesWithContext(ctx, &ec2.DescribeImagesInput{ - Filters: []*ec2.Filter{{Name: aws.String("image-id"), Values: aws.StringSlice(lo.Map(res, func(a AMI, _ int) string { return a.AmiID }))}}, - MaxResults: aws.Int64(500), + Filters: []*ec2.Filter{{Name: aws.String("image-id"), Values: aws.StringSlice(lo.Map(res, func(a AMI, _ int) string { return a.AmiID }))}}, + MaxResults: aws.Int64(500), + IncludeDeprecated: lo.ToPtr(true), }, func(page *ec2.DescribeImagesOutput, _ bool) bool { for i := range page.Images { for j := range res {