diff --git a/cluster-autoscaler/clusterstate/clusterstate.go b/cluster-autoscaler/clusterstate/clusterstate.go index 6607f7ec4e32..8653b6ce5dd1 100644 --- a/cluster-autoscaler/clusterstate/clusterstate.go +++ b/cluster-autoscaler/clusterstate/clusterstate.go @@ -432,6 +432,11 @@ func (csr *ClusterStateRegistry) IsNodeGroupSafeToScaleUp(nodeGroup cloudprovide } func (csr *ClusterStateRegistry) getProvisionedAndTargetSizesForNodeGroup(nodeGroupName string) (provisioned, target int, ok bool) { + if len(csr.acceptableRanges) == 0 { + klog.Warningf("AcceptableRanges have not been populated yet. Skip checking") + return 0, 0, false + } + acceptable, found := csr.acceptableRanges[nodeGroupName] if !found { klog.Warningf("Failed to find acceptable ranges for %v", nodeGroupName)