Skip to content

Commit

Permalink
Merge pull request #6753 from granular-ryanbonham/fix_6751
Browse files Browse the repository at this point in the history
Use version number as well as name when checking LaunchTemplates
  • Loading branch information
k8s-ci-robot authored Apr 8, 2019
2 parents 3e81a3f + eca2b0a commit d1fc04d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions upup/pkg/fi/cloudup/awsup/aws_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,10 @@ func findAutoscalingGroupLaunchConfiguration(g *autoscaling.Group) (string, erro
// @check the launch template then
if g.LaunchTemplate != nil {
name = aws.StringValue(g.LaunchTemplate.LaunchTemplateName)
version := aws.StringValue(g.LaunchTemplate.Version)
if name != "" {
return name, nil
launchTemplate := name + ":" + version
return launchTemplate, nil
}
}

Expand All @@ -571,8 +573,10 @@ func findAutoscalingGroupLaunchConfiguration(g *autoscaling.Group) (string, erro
if g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification != nil {
// honestly!!
name = aws.StringValue(g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.LaunchTemplateName)
version := aws.StringValue(g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.Version)
if name != "" {
return name, nil
launchTemplate := name + ":" + version
return launchTemplate, nil
}
}
}
Expand All @@ -591,8 +595,10 @@ func findInstanceLaunchConfiguration(i *autoscaling.Instance) string {
// else we need to check the launch template
if i.LaunchTemplate != nil {
name = aws.StringValue(i.LaunchTemplate.LaunchTemplateName)
version := aws.StringValue(i.LaunchTemplate.Version)
if name != "" {
return name
launchTemplate := name + ":" + version
return launchTemplate
}
}

Expand Down

0 comments on commit d1fc04d

Please sign in to comment.