Skip to content

Commit

Permalink
Added handler for ASG MixedInstancesPolicy
Browse files Browse the repository at this point in the history
* Enables the ASG instance type to be determined from the LaunchTemplate
default
* This makes it possible to have a mixed instance ASG, relying on AWS'
native logic for things like on-demand launch priority and spot
instances etc
  • Loading branch information
drewhemm committed Apr 12, 2019
1 parent bdce461 commit a6ce5d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ func (m *asgCache) buildAsgFromAWS(g *autoscaling.Group) (*asg, error) {
func (m *asgCache) buildLaunchTemplateParams(g *autoscaling.Group) (string, string) {
if g.LaunchTemplate != nil {
return aws.StringValue(g.LaunchTemplate.LaunchTemplateName), aws.StringValue(g.LaunchTemplate.Version)
} else if g.MixedInstancesPolicy != nil && g.MixedInstancesPolicy.LaunchTemplate != nil {
return aws.StringValue(g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.LaunchTemplateName),
aws.StringValue(g.MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.Version)
}

return "", ""
Expand Down

0 comments on commit a6ce5d9

Please sign in to comment.