From d4bfe15de2ecc024b9ba054d589b96132a1deeea Mon Sep 17 00:00:00 2001 From: Austin Siu Date: Tue, 1 Mar 2022 16:36:19 -0600 Subject: [PATCH] Fix guard on instance type overrides when requirements present --- cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go b/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go index bd83e9a847c..838a6942211 100644 --- a/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go +++ b/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go @@ -557,7 +557,7 @@ func (m *asgCache) buildAsgFromAWS(g *autoscaling.Group) (*asg, error) { instanceRequirementsOverrides: getInstanceTypeRequirements(g.MixedInstancesPolicy.LaunchTemplate.Overrides), } - if asg.MixedInstancesPolicy.instanceTypesOverrides != nil && asg.MixedInstancesPolicy.instanceRequirementsOverrides != nil { + if len(asg.MixedInstancesPolicy.instanceTypesOverrides) != 0 && asg.MixedInstancesPolicy.instanceRequirementsOverrides != nil { return nil, fmt.Errorf("invalid setup of both instance type and instance requirements overrides configured") } }