From 0d278a2554f38308575231a8bd179e21b891cf12 Mon Sep 17 00:00:00 2001 From: Jiaxin Shan Date: Wed, 9 Oct 2019 17:58:06 -0700 Subject: [PATCH] Skip acceptable range check before it has data --- cluster-autoscaler/clusterstate/clusterstate.go | 5 +++++ 1 file changed, 5 insertions(+) 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)