From df5789248a247c2188000c3e20a232b913d9b969 Mon Sep 17 00:00:00 2001 From: Suket Sharma Date: Fri, 4 Feb 2022 14:35:36 -0800 Subject: [PATCH] Choose the latest version of the EC2 launchTemplate by default (#1272) --- pkg/cloudprovider/aws/instance.go | 2 +- pkg/cloudprovider/aws/suite_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/cloudprovider/aws/instance.go b/pkg/cloudprovider/aws/instance.go index bd2f3202cd31..b04121880331 100644 --- a/pkg/cloudprovider/aws/instance.go +++ b/pkg/cloudprovider/aws/instance.go @@ -164,7 +164,7 @@ func (p *InstanceProvider) getLaunchTemplateConfigs(ctx context.Context, constra Overrides: p.getOverrides(instanceTypes, subnets, constraints.Requirements.Zones(), capacityType), LaunchTemplateSpecification: &ec2.FleetLaunchTemplateSpecificationRequest{ LaunchTemplateName: aws.String(launchTemplateName), - Version: aws.String("$Default"), + Version: aws.String("$Latest"), }, } if len(launchTemplateConfig.Overrides) > 0 { diff --git a/pkg/cloudprovider/aws/suite_test.go b/pkg/cloudprovider/aws/suite_test.go index 388f507b20e0..e94ca3b27f9d 100644 --- a/pkg/cloudprovider/aws/suite_test.go +++ b/pkg/cloudprovider/aws/suite_test.go @@ -421,7 +421,7 @@ var _ = Describe("Allocation", func() { launchTemplate := createFleetInput.LaunchTemplateConfigs[0].LaunchTemplateSpecification Expect(*launchTemplate.LaunchTemplateName).To(Equal(*createLaunchTemplateInput.LaunchTemplateName)) Expect(createLaunchTemplateInput.LaunchTemplateData.BlockDeviceMappings[0].Ebs.Encrypted).To(Equal(aws.Bool(true))) - Expect(*launchTemplate.Version).To(Equal("$Default")) + Expect(*launchTemplate.Version).To(Equal("$Latest")) }) It("should allow a launch template to be specified", func() { provider.LaunchTemplate = aws.String("test-launch-template") @@ -432,7 +432,7 @@ var _ = Describe("Allocation", func() { Expect(input.LaunchTemplateConfigs).To(HaveLen(1)) launchTemplate := input.LaunchTemplateConfigs[0].LaunchTemplateSpecification Expect(*launchTemplate.LaunchTemplateName).To(Equal("test-launch-template")) - Expect(*launchTemplate.Version).To(Equal("$Default")) + Expect(*launchTemplate.Version).To(Equal("$Latest")) }) }) Context("Subnets", func() {