Change:
Since this PR got merged, the ELB e2e test, which was consistently succeeding, is now consistently failing: Revert now that is in, and fix the tests that were relying on it. (details) Commit by arob Revert now that is in, and fix the tests that were relying on it. The file was modified The file was modified The file was modified I'm going to roll it back to confirm.

Discussion:
import ( "net" <ins> "strings" </ins> "github.com/GoogleCloudPlatform/kubernetes/pkg/api" )

Master(clusterName string) (string, error) } <del> func GetLoadBalancerName(clusterName, serviceNamespace, serviceName string) string { return clusterName + "-" + serviceNamespace + "-" + serviceName </del> <ins> // TODO(#6812): Use a shorter name that's less likely to be longer than cloud // providers' name length limits. func GetLoadBalancerName(service *api.Service) string { //GCE requires that the name of a load balancer starts with a lower case letter. ret := "a" + string(service.UID) ret = strings.Replace(ret, "-", "", -1) //AWS requires that the name of a load balancer is shorter than 32 bytes. if len(ret) > 32 { ret = ret[:32] } return ret </ins> } // TCPLoadBalancer is an abstract, pluggable interface for TCP load balancers.

} func (s *ServiceController) loadBalancerName(service *api.Service) string { <del> return cloudprovider.GetLoadBalancerName(s.clusterName, service.Namespace, service.Name) </del> <ins> return cloudprovider.GetLoadBalancerName(service) </ins> } func getTCPPorts(service *api.Service) ([]int, error) {

return nil } <del> name := s.loadBalancerName(service) </del> <ins> name := cloudprovider.GetLoadBalancerName(service) </ins> err := s.balancer.UpdateTCPLoadBalancer(name, s.zone.Region, hosts) if err == nil { return nil

) const region = "us-central" <del> const clusterName = "test-cluster" const namespace = "namespace" </del> func newService(name string, uid types.UID, external bool) *api.Service { <del> return &api.Service{ObjectMeta: api.ObjectMeta{Name: name, Namespace: namespace, UID: uid}, Spec: api.ServiceSpec{CreateExternalLoadBalancer: external}} } func lbName(serviceName string) string { return clusterName + "-" + namespace + "-" + serviceName </del> <ins> return &api.Service{ObjectMeta: api.ObjectMeta{Name: name, Namespace: "namespace", UID: uid}, Spec: api.ServiceSpec{CreateExternalLoadBalancer: external}} </ins> } func TestCreateExternalLoadBalancer(t *testing.T) {

cloud := &fake_cloud.FakeCloud{} cloud.Region = region client := &testclient.Fake{} <del> controller := New(cloud, client, clusterName) </del> <ins> controller := New(cloud, client, "test-cluster") </ins> controller.init() cloud.Calls = nil    // ignore any cloud calls made in init() client.Actions = nil // ignore any client calls made in init()

newService("s0", "333", true), }, expectedUpdateCalls: []fake_cloud.FakeUpdateBalancerCall{ <del> {Name: lbName("s0"), Region: region, Hosts: []string{"node0", "node1", "node73"}}, </del> <ins> {Name: "a333", Region: region, Hosts: []string{"node0", "node1", "node73"}}, </ins> }, }, {

newService("s2", "666", true), }, expectedUpdateCalls: []fake_cloud.FakeUpdateBalancerCall{ <del> {Name: lbName("s0"), Region: region, Hosts: []string{"node0", "node1", "node73"}}, {Name: lbName("s1"), Region: region, Hosts: []string{"node0", "node1", "node73"}}, {Name: lbName("s2"), Region: region, Hosts: []string{"node0", "node1", "node73"}}, </del> <ins> {Name: "a444", Region: region, Hosts: []string{"node0", "node1", "node73"}}, {Name: "a555", Region: region, Hosts: []string{"node0", "node1", "node73"}}, {Name: "a666", Region: region, Hosts: []string{"node0", "node1", "node73"}}, </ins> }, }, {

newService("s4", "123", false), }, expectedUpdateCalls: []fake_cloud.FakeUpdateBalancerCall{ <del> {Name: lbName("s1"), Region: region, Hosts: []string{"node0", "node1", "node73"}}, {Name: lbName("s3"), Region: region, Hosts: []string{"node0", "node1", "node73"}}, </del> <ins> {Name: "a888", Region: region, Hosts: []string{"node0", "node1", "node73"}}, {Name: "a999", Region: region, Hosts: []string{"node0", "node1", "node73"}}, </ins> }, }, }

cloud.Region = region client := &testclient.Fake{} <del> controller := New(cloud, client, clusterName) </del> <ins> controller := New(cloud, client, "test-cluster2") </ins> controller.init() cloud.Calls = nil // ignore any cloud calls made in init()