Skip to content

Commit

Permalink
Choose the latest version of the EC2 launchTemplate by default (#1272)
Browse files Browse the repository at this point in the history
  • Loading branch information
suket22 authored Feb 4, 2022
1 parent dd1dfea commit df57892
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/cloudprovider/aws/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/cloudprovider/aws/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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() {
Expand Down

0 comments on commit df57892

Please sign in to comment.