Merge pull request #10187 from hakman/fix-spot-instances

Fix auto scaling group changes when using spot instances
This commit is contained in:
Kubernetes Prow Robot 2020-11-07 21:49:38 -08:00 committed by GitHub
commit af5cd1a5fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 7 deletions

View File

@ -455,13 +455,14 @@ func (v *AutoscalingGroup) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *Autos
}
if changes.LaunchTemplate != nil {
// @note: at the moment we are only using launch templates when using mixed instance policies,
// but this might change
setup(request).LaunchTemplate = &autoscaling.LaunchTemplate{
LaunchTemplateSpecification: &autoscaling.LaunchTemplateSpecification{
LaunchTemplateName: changes.LaunchTemplate.ID,
spec := &autoscaling.LaunchTemplateSpecification{
LaunchTemplateId: changes.LaunchTemplate.ID,
Version: &launchTemplateVersion,
},
}
if e.UseMixedInstancesPolicy() {
setup(request).LaunchTemplate = &autoscaling.LaunchTemplate{LaunchTemplateSpecification: spec}
} else {
request.LaunchTemplate = spec
}
changes.LaunchTemplate = nil
}