@@ -289,7 +289,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
289
289
Expect (awsEnv .EC2API .CreateFleetBehavior .CalledWithInput .Len ()).To (BeNumerically ("==" , 1 ))
290
290
createFleetInput := awsEnv .EC2API .CreateFleetBehavior .CalledWithInput .Pop ()
291
291
Expect (len (createFleetInput .LaunchTemplateConfigs )).To (BeNumerically ("==" , awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()))
292
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
292
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
293
293
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
294
294
launchTemplate , ok := lo .Find (createFleetInput .LaunchTemplateConfigs , func (ltConfig * ec2.FleetLaunchTemplateConfigRequest ) bool {
295
295
return * ltConfig .LaunchTemplateSpecification .LaunchTemplateName == * ltInput .LaunchTemplateName
@@ -315,7 +315,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
315
315
pod := coretest .UnschedulablePod ()
316
316
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
317
317
ExpectScheduled (ctx , env .Client , pod )
318
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
318
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
319
319
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
320
320
Expect (* ltInput .LaunchTemplateData .IamInstanceProfile .Name ).To (Equal ("overridden-profile" ))
321
321
})
@@ -385,7 +385,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
385
385
pod := coretest .UnschedulablePod ()
386
386
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
387
387
ExpectScheduled (ctx , env .Client , pod )
388
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
388
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 2 ))
389
389
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
390
390
ltName := aws .StringValue (ltInput .LaunchTemplateName )
391
391
lt , ok := awsEnv .LaunchTemplateCache .Get (ltName )
@@ -601,7 +601,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
601
601
pod := coretest .UnschedulablePod ()
602
602
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
603
603
ExpectScheduled (ctx , env .Client , pod )
604
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
604
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
605
605
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
606
606
Expect (len (ltInput .LaunchTemplateData .BlockDeviceMappings )).To (Equal (1 ))
607
607
Expect (* ltInput .LaunchTemplateData .BlockDeviceMappings [0 ].Ebs .VolumeSize ).To (Equal (int64 (20 )))
@@ -617,7 +617,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
617
617
pod := coretest .UnschedulablePod ()
618
618
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
619
619
ExpectScheduled (ctx , env .Client , pod )
620
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
620
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
621
621
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
622
622
Expect (len (ltInput .LaunchTemplateData .BlockDeviceMappings )).To (Equal (1 ))
623
623
Expect (* ltInput .LaunchTemplateData .BlockDeviceMappings [0 ].Ebs .VolumeSize ).To (Equal (int64 (20 )))
@@ -655,7 +655,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
655
655
pod := coretest .UnschedulablePod ()
656
656
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
657
657
ExpectScheduled (ctx , env .Client , pod )
658
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
658
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
659
659
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
660
660
Expect (ltInput .LaunchTemplateData .BlockDeviceMappings [0 ].Ebs ).To (Equal (& ec2.LaunchTemplateEbsBlockDeviceRequest {
661
661
VolumeSize : aws .Int64 (187 ),
@@ -705,7 +705,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
705
705
pod := coretest .UnschedulablePod ()
706
706
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
707
707
ExpectScheduled (ctx , env .Client , pod )
708
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
708
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
709
709
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
710
710
// Both of these values are rounded up when converting to Gibibytes
711
711
Expect (aws .Int64Value (ltInput .LaunchTemplateData .BlockDeviceMappings [0 ].Ebs .VolumeSize )).To (BeNumerically ("==" , 4 ))
@@ -718,7 +718,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
718
718
pod := coretest .UnschedulablePod ()
719
719
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
720
720
ExpectScheduled (ctx , env .Client , pod )
721
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
721
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
722
722
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
723
723
Expect (len (ltInput .LaunchTemplateData .BlockDeviceMappings )).To (Equal (2 ))
724
724
// Bottlerocket control volume
@@ -738,7 +738,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
738
738
pod := coretest .UnschedulablePod ()
739
739
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
740
740
ExpectScheduled (ctx , env .Client , pod )
741
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
741
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 2 ))
742
742
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
743
743
Expect (len (ltInput .LaunchTemplateData .BlockDeviceMappings )).To (Equal (0 ))
744
744
})
@@ -763,7 +763,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
763
763
pod := coretest .UnschedulablePod ()
764
764
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
765
765
ExpectScheduled (ctx , env .Client , pod )
766
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
766
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 2 ))
767
767
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
768
768
Expect (len (ltInput .LaunchTemplateData .BlockDeviceMappings )).To (Equal (1 ))
769
769
Expect (* ltInput .LaunchTemplateData .BlockDeviceMappings [0 ].Ebs .VolumeSize ).To (Equal (int64 (40 )))
@@ -1127,6 +1127,19 @@ var _ = Describe("LaunchTemplate Provider", func() {
1127
1127
ExpectScheduled (ctx , env .Client , pod )
1128
1128
ExpectLaunchTemplatesCreatedWithUserDataContaining ("--use-max-pods false" , "--max-pods=10" )
1129
1129
})
1130
+ It ("should generate different launch templates for different --max-pods values when specifying kubelet configuration" , func () {
1131
+ // We validate that we no longer combine instance types into the same launch template with the same --max-pods values
1132
+ // that shouldn't have been combined but were combined due to a pointer error
1133
+ nodeClass .Spec .Kubelet = & v1.KubeletConfiguration {
1134
+ ClusterDNS : []string {"test" },
1135
+ }
1136
+ ExpectApplied (ctx , env .Client , nodePool , nodeClass )
1137
+ pod := coretest .UnschedulablePod ()
1138
+ ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1139
+ ExpectScheduled (ctx , env .Client , pod )
1140
+ // We expect to generate 5 launch templates for our image/max-pods combination where we were only generating 2 before
1141
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("==" , 5 ))
1142
+ })
1130
1143
It ("should specify --system-reserved when overriding system reserved values" , func () {
1131
1144
nodeClass .Spec .Kubelet = & v1.KubeletConfiguration {
1132
1145
SystemReserved : map [string ]string {
@@ -1139,7 +1152,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1139
1152
pod := coretest .UnschedulablePod ()
1140
1153
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1141
1154
ExpectScheduled (ctx , env .Client , pod )
1142
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1155
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
1143
1156
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1144
1157
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1145
1158
Expect (err ).To (BeNil ())
@@ -1166,7 +1179,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1166
1179
pod := coretest .UnschedulablePod ()
1167
1180
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1168
1181
ExpectScheduled (ctx , env .Client , pod )
1169
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1182
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
1170
1183
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1171
1184
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1172
1185
Expect (err ).To (BeNil ())
@@ -1193,7 +1206,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1193
1206
pod := coretest .UnschedulablePod ()
1194
1207
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1195
1208
ExpectScheduled (ctx , env .Client , pod )
1196
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1209
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
1197
1210
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1198
1211
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1199
1212
Expect (err ).To (BeNil ())
@@ -1225,7 +1238,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1225
1238
pod := coretest .UnschedulablePod ()
1226
1239
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1227
1240
ExpectScheduled (ctx , env .Client , pod )
1228
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1241
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
1229
1242
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1230
1243
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1231
1244
Expect (err ).To (BeNil ())
@@ -1257,7 +1270,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1257
1270
pod := coretest .UnschedulablePod ()
1258
1271
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1259
1272
ExpectScheduled (ctx , env .Client , pod )
1260
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1273
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
1261
1274
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1262
1275
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1263
1276
Expect (err ).To (BeNil ())
@@ -1437,7 +1450,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1437
1450
pod := coretest .UnschedulablePod ()
1438
1451
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1439
1452
ExpectScheduled (ctx , env .Client , pod )
1440
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1453
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 2 ))
1441
1454
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1442
1455
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1443
1456
Expect (err ).To (BeNil ())
@@ -1461,7 +1474,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1461
1474
pod := coretest .UnschedulablePod ()
1462
1475
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1463
1476
ExpectScheduled (ctx , env .Client , pod )
1464
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1477
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
1465
1478
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1466
1479
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1467
1480
Expect (err ).To (BeNil ())
@@ -1485,7 +1498,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1485
1498
pod := coretest .UnschedulablePod ()
1486
1499
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1487
1500
ExpectScheduled (ctx , env .Client , pod )
1488
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1501
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
1489
1502
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1490
1503
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1491
1504
Expect (err ).To (BeNil ())
@@ -1505,7 +1518,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1505
1518
pod := coretest .UnschedulablePod ()
1506
1519
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1507
1520
ExpectScheduled (ctx , env .Client , pod )
1508
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1521
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 2 ))
1509
1522
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1510
1523
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1511
1524
Expect (err ).To (BeNil ())
@@ -1523,7 +1536,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1523
1536
pod := coretest .UnschedulablePod ()
1524
1537
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1525
1538
ExpectScheduled (ctx , env .Client , pod )
1526
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1539
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
1527
1540
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1528
1541
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1529
1542
Expect (err ).To (BeNil ())
@@ -1543,7 +1556,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1543
1556
pod := coretest .UnschedulablePod ()
1544
1557
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1545
1558
ExpectScheduled (ctx , env .Client , pod )
1546
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1559
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
1547
1560
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1548
1561
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1549
1562
Expect (err ).To (BeNil ())
@@ -1560,7 +1573,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1560
1573
pod := coretest .UnschedulablePod ()
1561
1574
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1562
1575
ExpectScheduled (ctx , env .Client , pod )
1563
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1576
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 2 ))
1564
1577
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1565
1578
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1566
1579
Expect (err ).To (BeNil ())
@@ -1578,7 +1591,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1578
1591
pod := coretest .UnschedulablePod ()
1579
1592
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1580
1593
ExpectScheduled (ctx , env .Client , pod )
1581
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
1594
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
1582
1595
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1583
1596
userData , err := base64 .StdEncoding .DecodeString (* ltInput .LaunchTemplateData .UserData )
1584
1597
Expect (err ).To (BeNil ())
@@ -1861,7 +1874,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1861
1874
pod := coretest .UnschedulablePod ()
1862
1875
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1863
1876
ExpectScheduled (ctx , env .Client , pod )
1864
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("> =" , 1 ))
1877
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("= =" , 1 ))
1865
1878
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1866
1879
Expect ("ami-123" ).To (Equal (* ltInput .LaunchTemplateData .ImageId ))
1867
1880
})
@@ -1988,7 +2001,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
1988
2001
pod := coretest .UnschedulablePod ()
1989
2002
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
1990
2003
ExpectScheduled (ctx , env .Client , pod )
1991
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("> =" , 1 ))
2004
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("= =" , 1 ))
1992
2005
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
1993
2006
Expect ("ami-456" ).To (Equal (* ltInput .LaunchTemplateData .ImageId ))
1994
2007
})
@@ -2127,7 +2140,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
2127
2140
pod := coretest .UnschedulablePod ()
2128
2141
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
2129
2142
ExpectScheduled (ctx , env .Client , pod )
2130
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
2143
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
2131
2144
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
2132
2145
Expect (aws .BoolValue (ltInput .LaunchTemplateData .Monitoring .Enabled )).To (BeFalse ())
2133
2146
})
@@ -2139,7 +2152,7 @@ var _ = Describe("LaunchTemplate Provider", func() {
2139
2152
pod := coretest .UnschedulablePod ()
2140
2153
ExpectProvisioned (ctx , env .Client , cluster , cloudProvider , prov , pod )
2141
2154
ExpectScheduled (ctx , env .Client , pod )
2142
- Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">= " , 1 ))
2155
+ Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically ("== " , 5 ))
2143
2156
awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .ForEach (func (ltInput * ec2.CreateLaunchTemplateInput ) {
2144
2157
Expect (aws .BoolValue (ltInput .LaunchTemplateData .Monitoring .Enabled )).To (BeTrue ())
2145
2158
})
@@ -2158,15 +2171,6 @@ func ExpectTags(tags []*ec2.Tag, expected map[string]string) {
2158
2171
}
2159
2172
}
2160
2173
2161
- func ExpectTagsNotFound (tags []* ec2.Tag , expectNotFound map [string ]string ) {
2162
- GinkgoHelper ()
2163
- existingTags := lo .SliceToMap (tags , func (t * ec2.Tag ) (string , string ) { return * t .Key , * t .Value })
2164
- for k , v := range expectNotFound {
2165
- elem , ok := existingTags [k ]
2166
- Expect (! ok || v != elem ).To (BeTrue ())
2167
- }
2168
- }
2169
-
2170
2174
func ExpectLaunchTemplatesCreatedWithUserDataContaining (substrings ... string ) {
2171
2175
GinkgoHelper ()
2172
2176
Expect (awsEnv .EC2API .CalledWithCreateLaunchTemplateInput .Len ()).To (BeNumerically (">=" , 1 ))
0 commit comments