mirror of https://github.com/kubernetes/kops.git
Merge pull request #8567 from qqshfox/fix-lt
Treat nil of LaunchTemplateSpecification.Version as $Default [0]
This commit is contained in:
commit
22cd49b6f1
|
@ -598,7 +598,7 @@ func findAutoscalingGroupLaunchConfiguration(c AWSCloud, g *autoscaling.Group) (
|
|||
//See what version the ASG is set to use
|
||||
mixedVersion := aws.StringValue(g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.Version)
|
||||
//Correctly Handle Default and Latest Versions
|
||||
if mixedVersion == "$Default" || mixedVersion == "$Latest" {
|
||||
if mixedVersion == "" || mixedVersion == "$Default" || mixedVersion == "$Latest" {
|
||||
request := &ec2.DescribeLaunchTemplatesInput{
|
||||
LaunchTemplateNames: []*string{&name},
|
||||
}
|
||||
|
@ -607,7 +607,7 @@ func findAutoscalingGroupLaunchConfiguration(c AWSCloud, g *autoscaling.Group) (
|
|||
return "", fmt.Errorf("error describing launch templates: %v", err)
|
||||
}
|
||||
launchTemplate := dltResponse.LaunchTemplates[0]
|
||||
if mixedVersion == "$Default" {
|
||||
if mixedVersion == "" || mixedVersion == "$Default" {
|
||||
version = strconv.FormatInt(*launchTemplate.DefaultVersionNumber, 10)
|
||||
} else {
|
||||
version = strconv.FormatInt(*launchTemplate.LatestVersionNumber, 10)
|
||||
|
|
Loading…
Reference in New Issue