Merge pull request #1193 from towca/fix/jtuznik/cluster-size

Fix GetClusterSize to return actual size in line with the rest of CSR
This commit is contained in:
MaciekPytel 2018-08-27 15:31:01 +02:00 committed by GitHub
commit d188c5a87c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -895,7 +895,7 @@ func getNotRegisteredNodes(allNodes []*apiv1.Node, cloudProvider cloudprovider.C
}
// GetClusterSize calculates and returns cluster's current size and target size. The current size is the
// actual number of nodes registered in Kubernetes, the target size is the number of nodes the CA wants.
// actual number of nodes provisioned in Kubernetes, the target size is the number of nodes the CA wants.
func (csr *ClusterStateRegistry) GetClusterSize() (currentSize, targetSize int) {
csr.Lock()
defer csr.Unlock()
@ -903,6 +903,6 @@ func (csr *ClusterStateRegistry) GetClusterSize() (currentSize, targetSize int)
for _, accRange := range csr.acceptableRanges {
targetSize += accRange.CurrentTarget
}
currentSize = csr.totalReadiness.Registered
currentSize = csr.totalReadiness.Registered - csr.totalReadiness.NotStarted - csr.totalReadiness.LongNotStarted
return currentSize, targetSize
}