From b3a3526ad096fcf45f1121c4bccc46f2b2a3d99b Mon Sep 17 00:00:00 2001 From: liranp Date: Mon, 18 Oct 2021 16:04:04 +0300 Subject: [PATCH] feat(spot/ocean): get instance types from `mixedInstancesPolicy` --- pkg/model/awsmodel/spotinst.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/model/awsmodel/spotinst.go b/pkg/model/awsmodel/spotinst.go index 6158a73c98..ec99318035 100644 --- a/pkg/model/awsmodel/spotinst.go +++ b/pkg/model/awsmodel/spotinst.go @@ -544,6 +544,11 @@ func (b *SpotInstanceGroupModelBuilder) buildLaunchSpec(c *fi.ModelBuilderContex } } + policy := ig.Spec.MixedInstancesPolicy + if len(launchSpec.InstanceTypes) == 0 && policy != nil && len(policy.Instances) > 0 { + launchSpec.InstanceTypes = policy.Instances + } + // Capacity. minSize, maxSize := b.buildCapacity(ig) ocean.MinSize = fi.Int64(fi.Int64Value(ocean.MinSize) + fi.Int64Value(minSize))