Skip to content

Commit

Permalink
Merge pull request #1013 from alexei-led/master
Browse files Browse the repository at this point in the history
fixing #1012, cluster autoscaler requres a valid LT intance type
  • Loading branch information
errordeveloper authored Jul 17, 2019
2 parents 39336ba + bd60be2 commit 6461e6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/cfn/builder/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2499,7 +2499,7 @@ var _ = Describe("CloudFormation template builder API", func() {
Expect(ngTemplate.Resources).To(HaveKey("NodeGroupLaunchTemplate"))

launchTemplateData := getLaunchTemplateData(ngTemplate)
Expect(launchTemplateData.InstanceType).To(Equal(""))
Expect(launchTemplateData.InstanceType).To(Equal("m5.large"))
Expect(launchTemplateData.InstanceMarketOptions).To(BeNil())

nodeGroupProperties := getNodeGroupProperties(ngTemplate)
Expand Down
5 changes: 4 additions & 1 deletion pkg/cfn/builder/nodegroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package builder

import (
"fmt"

"github.com/kris-nova/logger"

cfn "github.com/aws/aws-sdk-go/service/cloudformation"
Expand Down Expand Up @@ -119,7 +120,7 @@ func (n *NodeGroupResourceSet) addResourcesForNodeGroup() error {
Ebs: &gfn.AWSEC2LaunchTemplate_Ebs{
VolumeSize: gfn.NewInteger(*volumeSize),
VolumeType: gfn.NewString(*n.spec.VolumeType),
Encrypted: gfn.NewBoolean(*n.spec.VolumeEncrypted),
Encrypted: gfn.NewBoolean(*n.spec.VolumeEncrypted),
},
}}
if api.IsSetAndNonEmptyString(n.spec.VolumeKmsKeyID) {
Expand Down Expand Up @@ -214,6 +215,8 @@ func newLaunchTemplateData(n *NodeGroupResourceSet) *gfn.AWSEC2LaunchTemplate_La
}
if !api.HasMixedInstances(n.spec) {
launchTemplateData.InstanceType = gfn.NewString(n.spec.InstanceType)
} else {
launchTemplateData.InstanceType = gfn.NewString(n.spec.InstancesDistribution.InstanceTypes[0])
}

return launchTemplateData
Expand Down

0 comments on commit 6461e6d

Please sign in to comment.