remove getAlphaInstanceGroupsToAdd
@@ -433,12 +433,7 @@ func (b *Backends) ensureBackendService(p ServicePort, igs []*compute.InstanceGr
// edgeHop checks the links of the given backend by executing an edge hop.
// It fixes broken links and updates the Backend accordingly.
func (b *Backends) edgeHop(be *BackendService, igs []*compute.InstanceGroup) error {
- addIGs := []*compute.InstanceGroup{}
- if be.Alpha != nil {
- addIGs = getAlphaInstanceGroupsToAdd(be, igs)
- } else {
- addIGs = getInstanceGroupsToAdd(be, igs)
- }
+ addIGs := getInstanceGroupsToAdd(be, igs)
if len(addIGs) == 0 {
return nil
}
@@ -598,6 +593,8 @@ func getBackendsForNEGs(negs []*computealpha.NetworkEndpointGroup) []*computealp
}
func getInstanceGroupsToAdd(be *BackendService, igs []*compute.InstanceGroup) []*compute.InstanceGroup {
+ // A GA link can be used to reference an alpha object - so we only need to
+ // check the GA InstanceGroups.
beName := be.Ga.Name
beIGs := sets.String{}
for _, existingBe := range be.Ga.Backends {
@@ -625,34 +622,6 @@ func getInstanceGroupsToAdd(be *BackendService, igs []*compute.InstanceGroup) []
return addIGs
}
-func getAlphaInstanceGroupsToAdd(be *BackendService, igs []*compute.InstanceGroup) []*compute.InstanceGroup {
- beName := be.Alpha.Name
- beIGs := sets.String{}
- for _, existingBe := range be.Alpha.Backends {
- beIGs.Insert(comparableGroupPath(existingBe.Group))
- }
-
- expectedIGs := sets.String{}
- for _, ig := range igs {
- expectedIGs.Insert(comparableGroupPath(ig.SelfLink))
- }
-
- if beIGs.IsSuperset(expectedIGs) {
- return nil
- }
- glog.V(2).Infof("Expected igs for backend service %v: %+v, current igs %+v",
- beName, expectedIGs.List(), beIGs.List())
-
- var addIGs []*compute.InstanceGroup
- for _, ig := range igs {
- if !beIGs.Has(comparableGroupPath(ig.SelfLink)) {
- addIGs = append(addIGs, ig)
- }
- }
-
- return addIGs
-}
-
// GC garbage collects services corresponding to ports in the given list.
func (b *Backends) GC(svcNodePorts []ServicePort) error {
knownPorts := sets.NewString()
