diff --git a/pkg/model/spotinstmodel/instance_group.go b/pkg/model/spotinstmodel/instance_group.go index e47e94a973..7f2e39a346 100644 --- a/pkg/model/spotinstmodel/instance_group.go +++ b/pkg/model/spotinstmodel/instance_group.go @@ -511,7 +511,7 @@ func (b *InstanceGroupModelBuilder) buildLaunchSpec(c *fi.ModelBuilderContext, Ocean: ocean, // link to Ocean } - // Instance types. + // Instance types and strategy. for k, v := range ig.ObjectMeta.Labels { switch k { case InstanceGroupLabelOceanInstanceTypesWhitelist, InstanceGroupLabelOceanInstanceTypes: @@ -519,6 +519,12 @@ func (b *InstanceGroupModelBuilder) buildLaunchSpec(c *fi.ModelBuilderContext, if err != nil { return err } + + case InstanceGroupLabelSpotPercentage: + launchSpec.SpotPercentage, err = parseInt(v) + if err != nil { + return err + } } } @@ -587,17 +593,6 @@ func (b *InstanceGroupModelBuilder) buildLaunchSpec(c *fi.ModelBuilderContext, } } - // Strategy. - for k, v := range ig.ObjectMeta.Labels { - switch k { - case InstanceGroupLabelSpotPercentage: - launchSpec.SpotPercentage, err = parseInt(v) - if err != nil { - return err - } - } - } - klog.V(4).Infof("Adding task: LaunchSpec/%s", fi.StringValue(launchSpec.Name)) c.AddTask(launchSpec)