Skip to content

Commit

Permalink
Merge pull request #406 from rramkumar1/remove-ensure-lb
Browse files Browse the repository at this point in the history
Remove EnsureLB from ClusterManager
  • Loading branch information
nicksardo authored Jul 18, 2018
2 parents 4b2f6f1 + 6fdd5fb commit 49e6516
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
16 changes: 0 additions & 16 deletions pkg/controller/cluster_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,22 +83,6 @@ func (c *ClusterManager) shutdown() error {
return c.backendPool.Shutdown()
}

// EnsureLoadBalancer creates the backend services and higher-level LB resources.
// - lb is the single cluster L7 loadbalancers we wish to exist. If they already
// exist, they should not have any broken links between say, a UrlMap and
// TargetHttpProxy.
// - lbServicePorts are the ports for which we require Backend Services.
// - igLinks are the links to the groups to be referenced by the Backend Services.
// If GCE runs out of quota, a googleapi 403 is returned.
func (c *ClusterManager) EnsureLoadBalancer(lb *loadbalancers.L7RuntimeInfo, lbServicePorts []utils.ServicePort, igLinks []string) error {
glog.V(4).Infof("EnsureLoadBalancer(%q lb, %v lbServicePorts, %v instanceGroups)", lb.String(), len(lbServicePorts), len(igLinks))
if err := c.backendPool.Ensure(uniq(lbServicePorts), igLinks); err != nil {
return err
}

return c.l7Pool.Sync(lb)
}

func (c *ClusterManager) EnsureInstanceGroupsAndPorts(nodeNames []string, servicePorts []utils.ServicePort) ([]*compute.InstanceGroup, error) {
// Convert to slice of NodePort int64s.
ports := []int64{}
Expand Down
10 changes: 7 additions & 3 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,13 @@ func (lbc *LoadBalancerController) ensureIngress(ing *extensions.Ingress, nodeNa
}
lb.UrlMap = urlMap

// Create the backend services and higher-level LB resources.
// Note: To ensure the load balancer, we only need the IG links.
if err = lbc.CloudClusterManager.EnsureLoadBalancer(lb, ingSvcPorts, utils.IGLinks(igs)); err != nil {
// Create the backends. Note that we only need the IG links.
if err := lbc.CloudClusterManager.backendPool.Ensure(uniq(ingSvcPorts), utils.IGLinks(igs)); err != nil {
return err
}

// Create higher-level LB resources.
if err := lbc.CloudClusterManager.l7Pool.Sync(lb); err != nil {
return err
}

Expand Down

0 comments on commit 49e6516

Please sign in to comment.