Skip to content

Drop support for Ubuntu 20.04 images #8470

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration/tests/managed/managed_nodegroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ var _ = Describe("(Integration) Create Managed Nodegroups", func() {

Entry("Ubuntu with dry-run", managedCLIEntry{
createArgs: []string{
"--node-ami-family=Ubuntu2004",
"--node-ami-family=Ubuntu2204",
"--dry-run",
},
}),
Expand Down
6 changes: 1 addition & 5 deletions pkg/ami/auto_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,6 @@ func MakeImageSearchPatterns(version string) map[string]map[int]string {
ImageClassGeneral: fmt.Sprintf("ubuntu-eks/k8s_%s/images/*22.04-amd64*", version),
ImageClassARM: fmt.Sprintf("ubuntu-eks/k8s_%s/images/*22.04-arm64*", version),
},
api.NodeImageFamilyUbuntu2004: {
ImageClassGeneral: fmt.Sprintf("ubuntu-eks/k8s_%s/images/*20.04-amd64*", version),
ImageClassARM: fmt.Sprintf("ubuntu-eks/k8s_%s/images/*20.04-arm64*", version),
},
api.NodeImageFamilyWindowsServer2019CoreContainer: {
ImageClassGeneral: fmt.Sprintf("Windows_Server-2019-English-Core-EKS_Optimized-%v-*", version),
},
Expand All @@ -77,7 +73,7 @@ func MakeImageSearchPatterns(version string) map[string]map[int]string {
// OwnerAccountID returns the AWS account ID that owns worker AMI.
func OwnerAccountID(imageFamily, region string) (string, error) {
switch imageFamily {
case api.NodeImageFamilyUbuntuPro2404, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2004, api.NodeImageFamilyUbuntu2004:
case api.NodeImageFamilyUbuntuPro2404, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2004:
return ownerIDUbuntuFamily, nil
case api.NodeImageFamilyAmazonLinux2023, api.NodeImageFamilyAmazonLinux2:
return api.EKSResourceAccountID(region), nil
Expand Down
24 changes: 2 additions & 22 deletions pkg/ami/ssm_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ func MakeSSMParameterName(version, instanceType, imageFamily string) (string, er
return fmt.Sprintf("/aws/service/ami-windows-latest/Windows_Server-2022-English-%s-EKS_Optimized-%s/%s", windowsAmiType(imageFamily), version, fieldName), nil
case api.NodeImageFamilyBottlerocket:
return fmt.Sprintf("/aws/service/bottlerocket/aws-k8s-%s/%s/latest/%s", imageType(imageFamily, instanceType, version), instanceEC2ArchName(instanceType), fieldName), nil
case api.NodeImageFamilyUbuntu2004,
api.NodeImageFamilyUbuntuPro2004,
case api.NodeImageFamilyUbuntuPro2004,
api.NodeImageFamilyUbuntu2204,
api.NodeImageFamilyUbuntuPro2204:
if err := validateVersionForUbuntu(version, imageFamily); err != nil {
Expand Down Expand Up @@ -184,7 +183,7 @@ func windowsAmiType(imageFamily string) string {

func ubuntuReleaseName(imageFamily string) string {
switch imageFamily {
case api.NodeImageFamilyUbuntu2004, api.NodeImageFamilyUbuntuPro2004:
case api.NodeImageFamilyUbuntuPro2004:
return "20.04"
case api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2204:
return "22.04"
Expand All @@ -197,25 +196,6 @@ func ubuntuReleaseName(imageFamily string) string {

func validateVersionForUbuntu(version, imageFamily string) error {
switch imageFamily {
case api.NodeImageFamilyUbuntu2004:
var err error
supportsUbuntu := false
const minVersion = api.Version1_21
const maxVersion = api.Version1_29
supportsUbuntu, err = utils.IsMinVersion(minVersion, version)
if err != nil {
return err
}
if !supportsUbuntu {
return &UnsupportedQueryError{msg: fmt.Sprintf("%s requires EKS version greater or equal than %s and lower than %s", imageFamily, minVersion, maxVersion)}
}
supportsUbuntu, err = utils.IsMinVersion(version, maxVersion)
if err != nil {
return err
}
if !supportsUbuntu {
return &UnsupportedQueryError{msg: fmt.Sprintf("%s requires EKS version greater or equal than %s and lower than %s", imageFamily, minVersion, maxVersion)}
}
case api.NodeImageFamilyUbuntuPro2004:
var err error
supportsUbuntu := false
Expand Down
72 changes: 0 additions & 72 deletions pkg/ami/ssm_resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,78 +234,6 @@ var _ = Describe("AMI Auto Resolution", func() {

})

Context("and Ubuntu2004 family", func() {
BeforeEach(func() {
p = mockprovider.NewMockProvider()
instanceType = "t2.medium"
imageFamily = "Ubuntu2004"
})

DescribeTable("should return an error",
func(version string) {
resolver := NewSSMResolver(p.MockSSM())
resolvedAmi, err = resolver.Resolve(context.Background(), region, version, instanceType, imageFamily)

Expect(err).To(HaveOccurred())
Expect(err).To(MatchError("Ubuntu2004 requires EKS version greater or equal than 1.21 and lower than 1.29"))
},
EntryDescription("When EKS version is %s"),
Entry(nil, "1.20"),
Entry(nil, "1.30"),
)

DescribeTable("should return a valid AMI",
func(version string) {
addMockGetParameter(p, fmt.Sprintf("/aws/service/canonical/ubuntu/eks/20.04/%s/stable/current/amd64/hvm/ebs-gp2/ami-id", version), expectedAmi)

resolver := NewSSMResolver(p.MockSSM())
resolvedAmi, err = resolver.Resolve(context.Background(), region, version, instanceType, imageFamily)

Expect(err).NotTo(HaveOccurred())
Expect(p.MockSSM().AssertNumberOfCalls(GinkgoT(), "GetParameter", 1)).To(BeTrue())
Expect(resolvedAmi).To(BeEquivalentTo(expectedAmi))
},
EntryDescription("When EKS version is %s"),
Entry(nil, "1.21"),
Entry(nil, "1.22"),
Entry(nil, "1.23"),
Entry(nil, "1.24"),
Entry(nil, "1.25"),
Entry(nil, "1.26"),
Entry(nil, "1.27"),
Entry(nil, "1.28"),
Entry(nil, "1.29"),
)

Context("for arm instance type", func() {
BeforeEach(func() {
instanceType = "c6g.12xlarge"
})
DescribeTable("should return a valid AMI for arm64",
func(version string) {
addMockGetParameter(p, fmt.Sprintf("/aws/service/canonical/ubuntu/eks/20.04/%s/stable/current/arm64/hvm/ebs-gp2/ami-id", version), expectedAmi)

resolver := NewSSMResolver(p.MockSSM())
resolvedAmi, err = resolver.Resolve(context.Background(), region, version, instanceType, imageFamily)

Expect(err).NotTo(HaveOccurred())
Expect(p.MockSSM().AssertNumberOfCalls(GinkgoT(), "GetParameter", 1)).To(BeTrue())
Expect(resolvedAmi).To(BeEquivalentTo(expectedAmi))
},
EntryDescription("When EKS version is %s"),
Entry(nil, "1.21"),
Entry(nil, "1.22"),
Entry(nil, "1.23"),
Entry(nil, "1.24"),
Entry(nil, "1.25"),
Entry(nil, "1.26"),
Entry(nil, "1.27"),
Entry(nil, "1.28"),
Entry(nil, "1.29"),
)
})
})

Context("and UbuntuPro2004 family", func() {
BeforeEach(func() {
p = mockprovider.NewMockProvider()
Expand Down
10 changes: 4 additions & 6 deletions pkg/apis/eksctl.io/v1alpha5/assets/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1386,8 +1386,8 @@
},
"amiFamily": {
"type": "string",
"description": "Valid variants are: `\"AmazonLinux2\"` (default), `\"AmazonLinux2023\"`, `\"UbuntuPro2404\"`, `\"Ubuntu2404\"`, `\"UbuntuPro2204\"`, `\"Ubuntu2204\"`, `\"UbuntuPro2004\"`, `\"Ubuntu2004\"`, `\"Bottlerocket\"`, `\"WindowsServer2019CoreContainer\"`, `\"WindowsServer2019FullContainer\"`, `\"WindowsServer2022CoreContainer\"`, `\"WindowsServer2022FullContainer\"`.",
"x-intellij-html-description": "Valid variants are: <code>&quot;AmazonLinux2&quot;</code> (default), <code>&quot;AmazonLinux2023&quot;</code>, <code>&quot;UbuntuPro2404&quot;</code>, <code>&quot;Ubuntu2404&quot;</code>, <code>&quot;UbuntuPro2204&quot;</code>, <code>&quot;Ubuntu2204&quot;</code>, <code>&quot;UbuntuPro2004&quot;</code>, <code>&quot;Ubuntu2004&quot;</code>, <code>&quot;Bottlerocket&quot;</code>, <code>&quot;WindowsServer2019CoreContainer&quot;</code>, <code>&quot;WindowsServer2019FullContainer&quot;</code>, <code>&quot;WindowsServer2022CoreContainer&quot;</code>, <code>&quot;WindowsServer2022FullContainer&quot;</code>.",
"description": "Valid variants are: `\"AmazonLinux2\"` (default), `\"AmazonLinux2023\"`, `\"UbuntuPro2404\"`, `\"Ubuntu2404\"`, `\"UbuntuPro2204\"`, `\"Ubuntu2204\"`, `\"UbuntuPro2004\"`, `\"Bottlerocket\"`, `\"WindowsServer2019CoreContainer\"`, `\"WindowsServer2019FullContainer\"`, `\"WindowsServer2022CoreContainer\"`, `\"WindowsServer2022FullContainer\"`.",
"x-intellij-html-description": "Valid variants are: <code>&quot;AmazonLinux2&quot;</code> (default), <code>&quot;AmazonLinux2023&quot;</code>, <code>&quot;UbuntuPro2404&quot;</code>, <code>&quot;Ubuntu2404&quot;</code>, <code>&quot;UbuntuPro2204&quot;</code>, <code>&quot;Ubuntu2204&quot;</code>, <code>&quot;UbuntuPro2004&quot;</code>, <code>&quot;Bottlerocket&quot;</code>, <code>&quot;WindowsServer2019CoreContainer&quot;</code>, <code>&quot;WindowsServer2019FullContainer&quot;</code>, <code>&quot;WindowsServer2022CoreContainer&quot;</code>, <code>&quot;WindowsServer2022FullContainer&quot;</code>.",
"default": "AmazonLinux2",
"enum": [
"AmazonLinux2",
Expand All @@ -1397,7 +1397,6 @@
"UbuntuPro2204",
"Ubuntu2204",
"UbuntuPro2004",
"Ubuntu2004",
"Bottlerocket",
"WindowsServer2019CoreContainer",
"WindowsServer2019FullContainer",
Expand Down Expand Up @@ -1736,8 +1735,8 @@
},
"amiFamily": {
"type": "string",
"description": "Valid variants are: `\"AmazonLinux2\"` (default), `\"AmazonLinux2023\"`, `\"UbuntuPro2404\"`, `\"Ubuntu2404\"`, `\"UbuntuPro2204\"`, `\"Ubuntu2204\"`, `\"UbuntuPro2004\"`, `\"Ubuntu2004\"`, `\"Bottlerocket\"`, `\"WindowsServer2019CoreContainer\"`, `\"WindowsServer2019FullContainer\"`, `\"WindowsServer2022CoreContainer\"`, `\"WindowsServer2022FullContainer\"`.",
"x-intellij-html-description": "Valid variants are: <code>&quot;AmazonLinux2&quot;</code> (default), <code>&quot;AmazonLinux2023&quot;</code>, <code>&quot;UbuntuPro2404&quot;</code>, <code>&quot;Ubuntu2404&quot;</code>, <code>&quot;UbuntuPro2204&quot;</code>, <code>&quot;Ubuntu2204&quot;</code>, <code>&quot;UbuntuPro2004&quot;</code>, <code>&quot;Ubuntu2004&quot;</code>, <code>&quot;Bottlerocket&quot;</code>, <code>&quot;WindowsServer2019CoreContainer&quot;</code>, <code>&quot;WindowsServer2019FullContainer&quot;</code>, <code>&quot;WindowsServer2022CoreContainer&quot;</code>, <code>&quot;WindowsServer2022FullContainer&quot;</code>.",
"description": "Valid variants are: `\"AmazonLinux2\"` (default), `\"AmazonLinux2023\"`, `\"UbuntuPro2404\"`, `\"Ubuntu2404\"`, `\"UbuntuPro2204\"`, `\"Ubuntu2204\"`, `\"UbuntuPro2004\"`, `\"Bottlerocket\"`, `\"WindowsServer2019CoreContainer\"`, `\"WindowsServer2019FullContainer\"`, `\"WindowsServer2022CoreContainer\"`, `\"WindowsServer2022FullContainer\"`.",
"x-intellij-html-description": "Valid variants are: <code>&quot;AmazonLinux2&quot;</code> (default), <code>&quot;AmazonLinux2023&quot;</code>, <code>&quot;UbuntuPro2404&quot;</code>, <code>&quot;Ubuntu2404&quot;</code>, <code>&quot;UbuntuPro2204&quot;</code>, <code>&quot;Ubuntu2204&quot;</code>, <code>&quot;UbuntuPro2004&quot;</code>, <code>&quot;Bottlerocket&quot;</code>, <code>&quot;WindowsServer2019CoreContainer&quot;</code>, <code>&quot;WindowsServer2019FullContainer&quot;</code>, <code>&quot;WindowsServer2022CoreContainer&quot;</code>, <code>&quot;WindowsServer2022FullContainer&quot;</code>.",
"default": "AmazonLinux2",
"enum": [
"AmazonLinux2",
Expand All @@ -1747,7 +1746,6 @@
"UbuntuPro2204",
"Ubuntu2204",
"UbuntuPro2004",
"Ubuntu2004",
"Bottlerocket",
"WindowsServer2019CoreContainer",
"WindowsServer2019FullContainer",
Expand Down
28 changes: 2 additions & 26 deletions pkg/apis/eksctl.io/v1alpha5/gpu_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,12 @@ var _ = Describe("GPU instance support", func() {
gpuInstanceType: "g5.12xlarge",
amiFamily: api.NodeImageFamilyAmazonLinux2,
}),
Entry("Ubuntu2004", gpuInstanceEntry{
amiFamily: api.NodeImageFamilyUbuntu2004,
gpuInstanceType: "g4dn.xlarge",
}),
Entry("Ubuntu2204", gpuInstanceEntry{
amiFamily: api.NodeImageFamilyUbuntu2004,
amiFamily: api.NodeImageFamilyUbuntu2204,
gpuInstanceType: "g4dn.xlarge",
}),
Entry("UbuntuPro2204", gpuInstanceEntry{
amiFamily: api.NodeImageFamilyUbuntu2004,
amiFamily: api.NodeImageFamilyUbuntuPro2204,
gpuInstanceType: "g4dn.xlarge",
}),
Entry("Bottlerocket INF", gpuInstanceEntry{
Expand Down Expand Up @@ -164,10 +160,6 @@ var _ = Describe("GPU instance support", func() {
amiFamily: api.NodeImageFamilyBottlerocket,
gpuInstanceType: "g4dn.xlarge",
}),
Entry("Ubuntu2004", gpuInstanceEntry{
amiFamily: api.NodeImageFamilyUbuntu2004,
gpuInstanceType: "g4dn.xlarge",
}),
Entry("Windows2019Core", gpuInstanceEntry{
amiFamily: api.NodeImageFamilyWindowsServer2019CoreContainer,
gpuInstanceType: "g3.8xlarge",
Expand Down Expand Up @@ -218,13 +210,6 @@ var _ = Describe("GPU instance support", func() {
Expect(output.String()).NotTo(ContainSubstring(api.GPUDriversWarning(mng.AMIFamily)))
}
},
Entry("Windows without GPU instances", gpuInstanceEntry{
amiFamily: api.NodeImageFamilyUbuntu2004,
instanceSelector: &api.InstanceSelector{
VCPUs: 4,
GPUs: newInt(0),
},
}),
Entry("Windows with explicit GPU instance", gpuInstanceEntry{
amiFamily: api.NodeImageFamilyWindowsServer2019FullContainer,
gpuInstanceType: "g4dn.xlarge",
Expand All @@ -237,14 +222,6 @@ var _ = Describe("GPU instance support", func() {
},
expectWarning: true,
}),
Entry("Ubuntu with implicit GPU instance", gpuInstanceEntry{
amiFamily: api.NodeImageFamilyUbuntu2004,
instanceSelector: &api.InstanceSelector{
VCPUs: 4,
GPUs: newInt(2),
},
expectWarning: true,
}),
)

Describe("No GPU instance type support validation for custom AMI", func() {
Expand Down Expand Up @@ -272,7 +249,6 @@ var _ = Describe("GPU instance support", func() {
},
Entry("AmazonLinux2", api.NodeImageFamilyAmazonLinux2, true),
Entry("AmazonLinux2023", api.NodeImageFamilyAmazonLinux2023, false),
Entry("Ubuntu2004", api.NodeImageFamilyUbuntu2004, false),
Entry("Windows2019Full", api.NodeImageFamilyWindowsServer2019FullContainer, true),
Entry("Windows2019Core", api.NodeImageFamilyWindowsServer2019CoreContainer, true),
Entry("Bottlerocket", api.NodeImageFamilyBottlerocket, false),
Expand Down
1 change: 0 additions & 1 deletion pkg/apis/eksctl.io/v1alpha5/outposts_validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ var _ = Describe("Outposts validation", func() {
},
Entry("AmazonLinux2", api.NodeImageFamilyAmazonLinux2, false),
Entry("Bottlerocket", api.NodeImageFamilyBottlerocket, true),
Entry("Ubuntu2004", api.NodeImageFamilyUbuntu2004, true),
Entry("UbuntuPro2004", api.NodeImageFamilyUbuntuPro2004, true),
Entry("Ubuntu2204", api.NodeImageFamilyUbuntu2204, true),
Entry("UbuntuPro2204", api.NodeImageFamilyUbuntuPro2204, true),
Expand Down
2 changes: 0 additions & 2 deletions pkg/apis/eksctl.io/v1alpha5/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,6 @@ const (
NodeImageFamilyUbuntuPro2204 = "UbuntuPro2204"
NodeImageFamilyUbuntu2204 = "Ubuntu2204"
NodeImageFamilyUbuntuPro2004 = "UbuntuPro2004"
NodeImageFamilyUbuntu2004 = "Ubuntu2004"
NodeImageFamilyBottlerocket = "Bottlerocket"

NodeImageFamilyWindowsServer2019CoreContainer = "WindowsServer2019CoreContainer"
Expand Down Expand Up @@ -566,7 +565,6 @@ func SupportedAMIFamilies() []string {
NodeImageFamilyUbuntuPro2204,
NodeImageFamilyUbuntu2204,
NodeImageFamilyUbuntuPro2004,
NodeImageFamilyUbuntu2004,
NodeImageFamilyBottlerocket,
NodeImageFamilyWindowsServer2019CoreContainer,
NodeImageFamilyWindowsServer2019FullContainer,
Expand Down
1 change: 0 additions & 1 deletion pkg/apis/eksctl.io/v1alpha5/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,6 @@ func IsUbuntuImage(imageFamily string) bool {
NodeImageFamilyUbuntuPro2204,
NodeImageFamilyUbuntu2204,
NodeImageFamilyUbuntuPro2004,
NodeImageFamilyUbuntu2004:
return true

default:
Expand Down
4 changes: 0 additions & 4 deletions pkg/apis/eksctl.io/v1alpha5/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2254,10 +2254,6 @@ var _ = Describe("ClusterConfig validation", func() {
err := api.ValidateManagedNodeGroup(0, mng)
Expect(err).NotTo(HaveOccurred())

mng.AMIFamily = api.NodeImageFamilyUbuntu2004
err = api.ValidateManagedNodeGroup(0, mng)
Expect(err).NotTo(HaveOccurred())

mng.AMIFamily = api.NodeImageFamilyUbuntuPro2004
err = api.ValidateManagedNodeGroup(0, mng)
Expect(err).NotTo(HaveOccurred())
Expand Down
10 changes: 0 additions & 10 deletions pkg/cfn/builder/managed_nodegroup_ami_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,16 +227,6 @@ var _ = DescribeTable("Managed Nodegroup AMI type", func(e amiTypeEntry) {
expectedAMIType: "BOTTLEROCKET_x86_64",
}),

Entry("non-native Ubuntu", amiTypeEntry{
nodeGroup: &api.ManagedNodeGroup{
NodeGroupBase: &api.NodeGroupBase{
Name: "test",
AMIFamily: api.NodeImageFamilyUbuntu2004,
},
},
expectedAMIType: "CUSTOM",
}),

Entry("non-native Ubuntu", amiTypeEntry{
nodeGroup: &api.ManagedNodeGroup{
NodeGroupBase: &api.NodeGroupBase{
Expand Down
2 changes: 1 addition & 1 deletion pkg/ctl/create/nodegroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ var _ = Describe("create nodegroup", func() {
Entry("with full-ecr-access flag", "--full-ecr-access", "true"),
Entry("with appmesh-access flag", "--appmesh-access", "true"),
Entry("with alb-ingress-access flag", "--alb-ingress-access", "true"),
Entry("with Ubuntu AMI", "--node-ami-family", "Ubuntu2004"),
Entry("with Ubuntu AMI", "--node-ami-family", "Ubuntu2204"),
Entry("with Bottlerocket AMI", "--node-ami-family", "Bottlerocket"),
Entry("with subnet-ids flag", "--subnet-ids", "id1,id2,id3"),
Entry("with Windows AMI", "--node-ami-family", "WindowsServer2019FullContainer"),
Expand Down
21 changes: 0 additions & 21 deletions pkg/eks/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,27 +279,6 @@ var _ = Describe("eksctl API", func() {
testEnsureAMI(Equal("ami-ssm"), "1.14")
})

It("should fall back to auto resolution for Ubuntu2004 on 1.14", func() {
ng.AMIFamily = api.NodeImageFamilyUbuntu2004
mockDescribeImages(provider, "ami-ubuntu", func(input *ec2.DescribeImagesInput) bool {
return input.Owners[0] == "099720109477"
})
testEnsureAMI(Equal("ami-ubuntu"), "1.14")
})

It("should resolve AMI using SSM Parameter Store for Ubuntu2004 on 1.29", func() {
provider.MockSSM().On("GetParameter", mock.Anything, &ssm.GetParameterInput{
Name: aws.String("/aws/service/canonical/ubuntu/eks/20.04/1.29/stable/current/amd64/hvm/ebs-gp2/ami-id"),
}).Return(&ssm.GetParameterOutput{
Parameter: &ssmtypes.Parameter{
Value: aws.String("ami-ubuntu"),
},
}, nil)
ng.AMIFamily = api.NodeImageFamilyUbuntu2004

testEnsureAMI(Equal("ami-ubuntu"), "1.29")
})

It("should fall back to auto resolution for UbuntuPro2004", func() {
ng.AMIFamily = api.NodeImageFamilyUbuntuPro2004
mockDescribeImages(provider, "ami-ubuntu", func(input *ec2.DescribeImagesInput) bool {
Expand Down
2 changes: 1 addition & 1 deletion pkg/nodebootstrap/managed_ubuntu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var _ = Describe("Managed Ubuntu User Data", func() {
clusterConfig.Status = be.clusterStatus
ng := &api.ManagedNodeGroup{
NodeGroupBase: &api.NodeGroupBase{
AMIFamily: api.NodeImageFamilyUbuntu2004,
AMIFamily: api.NodeImageFamilyUbuntu2204,
},
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/nodebootstrap/ubuntu_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var _ = Describe("Ubuntu User Data", func() {
clusterConfig.Status = &api.ClusterStatus{}
ng = &api.NodeGroup{
NodeGroupBase: &api.NodeGroupBase{
AMIFamily: "Ubuntu2004",
AMIFamily: "Ubuntu2204",
},
}
})
Expand Down
4 changes: 2 additions & 2 deletions pkg/nodebootstrap/userdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func NewBootstrapper(clusterConfig *api.ClusterConfig, ng *api.NodeGroup) (Boots
return NewWindowsBootstrapper(clusterConfig, ng, clusterDNS), nil
}
switch ng.AMIFamily {
case api.NodeImageFamilyUbuntuPro2404, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2004, api.NodeImageFamilyUbuntu2004:
case api.NodeImageFamilyUbuntuPro2404, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2004:
return NewUbuntuBootstrapper(clusterConfig, ng, clusterDNS), nil
case api.NodeImageFamilyBottlerocket:
return NewBottlerocketBootstrapper(clusterConfig, ng), nil
Expand Down Expand Up @@ -78,7 +78,7 @@ func NewManagedBootstrapper(clusterConfig *api.ClusterConfig, ng *api.ManagedNod
return NewManagedAL2Bootstrapper(ng), nil
case api.NodeImageFamilyBottlerocket:
return NewManagedBottlerocketBootstrapper(clusterConfig, ng), nil
case api.NodeImageFamilyUbuntu2004, api.NodeImageFamilyUbuntuPro2004, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2404:
case api.NodeImageFamilyUbuntuPro2004, api.NodeImageFamilyUbuntu2204, api.NodeImageFamilyUbuntuPro2204, api.NodeImageFamilyUbuntu2404, api.NodeImageFamilyUbuntuPro2404:
return NewUbuntuBootstrapper(clusterConfig, ng, clusterDNS), nil
}
return nil, nil
Expand Down
Loading