Skip to content

Commit

Permalink
fix: correctly check for latest alias
Browse files Browse the repository at this point in the history
  • Loading branch information
jmdeal committed Oct 30, 2024
1 parent 883fbc0 commit b5988e4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/providers/amifamily/ami.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ func (p *DefaultProvider) List(ctx context.Context, nodeClass *v1.EC2NodeClass)
// Discover deprecated AMIs if automatic AMI discovery and upgrade is enabled. This ensures we'll be able to
// provision in the event of an EKS optimized AMI being deprecated.
includeDeprecated := lo.ContainsBy(nodeClass.Spec.AMISelectorTerms, func(term v1.AMISelectorTerm) bool {
return term.Alias == "latest"
if term.Alias == "" {
return false
}
return v1.AMIVersionFromAlias(term.Alias) == "latest"
})
amis, err := p.amis(ctx, queries, includeDeprecated)
if err != nil {
Expand Down

0 comments on commit b5988e4

Please sign in to comment.