Properly handle nil cached services in the service controller's node reconciler.

Add a test that catches the former bug.
This commit is contained in:
Alex Robinson
2015-05-17 22:36:48 -07:00
parent efb42b302d
commit 3cf80e76c8
2 changed files with 21 additions and 1 deletions

View File

@@ -184,6 +184,16 @@ func TestUpdateNodesInExternalLoadBalancer(t *testing.T) {
{Name: "a999", Region: region, Hosts: []string{"node0", "node1", "node73"}},
},
},
{
// One service has an external load balancer and one is nil: one call.
services: []*api.Service{
newService("s0", "234", true),
nil,
},
expectedUpdateCalls: []fake_cloud.FakeUpdateBalancerCall{
{Name: "a234", Region: region, Hosts: []string{"node0", "node1", "node73"}},
},
},
}
for _, item := range table {
cloud := &fake_cloud.FakeCloud{}