diff --git a/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go b/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go index 6c34b7c726dc..6b7d1633309f 100644 --- a/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go +++ b/cluster-autoscaler/cloudprovider/aws/auto_scaling_groups.go @@ -609,11 +609,13 @@ func (m *asgCache) buildAsgFromAWS(g *autoscaling.Group) (*asg, error) { instanceRequirementsOverrides: getInstanceTypeRequirements(g.MixedInstancesPolicy.LaunchTemplate.Overrides), } - instanceRequirements, err := m.getInstanceRequirementsFromMixedInstancesPolicy(asg.MixedInstancesPolicy) - if err != nil { - return nil, fmt.Errorf("unable to retrieve instance requirements from mixed instance policy, err: %v", err) + if len(asg.MixedInstancesPolicy.instanceTypesOverrides) == 0 { + instanceRequirements, err := m.getInstanceRequirementsFromMixedInstancesPolicy(asg.MixedInstancesPolicy) + if err != nil { + return nil, fmt.Errorf("unable to retrieve instance requirements from mixed instance policy, err: %v", err) + } + asg.MixedInstancesPolicy.instanceRequirements = instanceRequirements } - asg.MixedInstancesPolicy.instanceRequirements = instanceRequirements 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")