Skip to content

Commit

Permalink
fix: Set InstanceTypes before provisioned early exit (#312)
Browse files Browse the repository at this point in the history
Signed-off-by: Jonah Back <[email protected]>
  • Loading branch information
backjo authored Jun 4, 2021
1 parent 63f73b4 commit 67a8a78
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions controllers/provisioners/eks/cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ func (ctx *EksInstanceGroupContext) CloudDiscovery() error {
vpcID := aws.StringValue(cluster.ResourcesVpcConfig.VpcId)
state.SetVPCId(vpcID)

instanceTypes, err := ctx.AwsWorker.DescribeInstanceTypes()
if err != nil {
return errors.Wrap(err, "failed to discover instance types")
}
state.SetInstanceTypeInfo(instanceTypes)

// find all owned scaling groups
ownedScalingGroups := ctx.findOwnedScalingGroups(scalingGroups)
state.SetOwnedScalingGroups(ownedScalingGroups)
Expand Down Expand Up @@ -206,12 +212,6 @@ func (ctx *EksInstanceGroupContext) CloudDiscovery() error {
status.SetCurrentMin(int(aws.Int64Value(targetScalingGroup.MinSize)))
status.SetCurrentMax(int(aws.Int64Value(targetScalingGroup.MaxSize)))

instanceTypes, err := ctx.AwsWorker.DescribeInstanceTypes()
if err != nil {
return errors.Wrap(err, "failed to discover instance types")
}
state.SetInstanceTypeInfo(instanceTypes)

if spec.IsLaunchConfiguration() {

state.ScalingConfiguration, err = scaling.NewLaunchConfiguration(instanceGroup.NamespacedName(), ctx.AwsWorker, &scaling.DiscoverConfigurationInput{
Expand Down

0 comments on commit 67a8a78

Please sign in to comment.