@@ -22,13 +22,19 @@ type amiTypeEntry struct {
2222 nodeGroup * api.ManagedNodeGroup
2323
2424 expectedAMIType string
25+ clusterVersion string
2526}
2627
2728var _ = DescribeTable ("Managed Nodegroup AMI type" , func (e amiTypeEntry ) {
2829 clusterConfig := api .NewClusterConfig ()
2930 clusterConfig .Status = & api.ClusterStatus {
3031 Endpoint : "https://test.com" ,
3132 }
33+ if e .clusterVersion != "" {
34+ clusterConfig .Metadata .Version = e .clusterVersion
35+ } else {
36+ clusterConfig .Metadata .Version = api .DefaultVersion
37+ }
3238 err := api .SetManagedNodeGroupDefaults (e .nodeGroup , clusterConfig .Metadata , false )
3339 Expect (err ).NotTo (HaveOccurred ())
3440 p := mockprovider .NewMockProvider ()
@@ -76,6 +82,7 @@ var _ = DescribeTable("Managed Nodegroup AMI type", func(e amiTypeEntry) {
7682 },
7783 },
7884 expectedAMIType : "AL2_x86_64" ,
85+ clusterVersion : api .Version1_32 ,
7986 }),
8087
8188 Entry ("default Nvidia GPU instance type" , amiTypeEntry {
@@ -107,6 +114,7 @@ var _ = DescribeTable("Managed Nodegroup AMI type", func(e amiTypeEntry) {
107114 },
108115 },
109116 expectedAMIType : "AL2_x86_64_GPU" ,
117+ clusterVersion : api .Version1_32 ,
110118 }),
111119
112120 Entry ("default ARM instance type" , amiTypeEntry {
@@ -128,6 +136,7 @@ var _ = DescribeTable("Managed Nodegroup AMI type", func(e amiTypeEntry) {
128136 },
129137 },
130138 expectedAMIType : "AL2_ARM_64" ,
139+ clusterVersion : api .Version1_32 ,
131140 }),
132141
133142 Entry ("Bottlerocket AMI type" , amiTypeEntry {
0 commit comments