Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
Merge pull request #118 from tianyuansun/master
Browse files Browse the repository at this point in the history
fix rs num
  • Loading branch information
wccsama authored Aug 19, 2019
2 parents f7990c3 + 2bfcb80 commit 878eb99
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/cloud-provider/load_balancer_blb_backend_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ func (bc *Baiducloud) reconcileBackendServers(service *v1.Service, nodes []*v1.N
if anno.LoadBalancerRsMaxNum > 0 {
targetRsNum = anno.LoadBalancerRsMaxNum
}
if len(nodes) < targetRsNum {
targetRsNum = len(nodes)
}
glog.Infof("nodes num is %d, target rs num is %d", len(nodes), targetRsNum)

// turn kube nodes list to backend list
var candidateBackends []blb.BackendServer
Expand All @@ -58,6 +54,11 @@ func (bc *Baiducloud) reconcileBackendServers(service *v1.Service, nodes []*v1.N
})
}

if len(candidateBackends) < targetRsNum {
targetRsNum = len(candidateBackends)
}
glog.Infof("nodes num is %d, target rs num is %d", len(candidateBackends), targetRsNum)

// get all existing rs from lb and change to map
existingBackends, err := bc.getAllBackendServer(lb)
if err != nil {
Expand Down

0 comments on commit 878eb99

Please sign in to comment.