Skip to content

Commit

Permalink
Skip acceptable range check before it has data
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffwan committed Oct 10, 2019
1 parent 8303a23 commit 0d278a2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cluster-autoscaler/clusterstate/clusterstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0d278a2

Please sign in to comment.