Ports could be in reverse order or otherwise.

This commit is contained in:
Andrew Butcher
2015-10-12 14:45:29 -04:00
parent efd8e3c9c7
commit a2c97c7b0e
2 changed files with 32 additions and 4 deletions

View File

@@ -291,6 +291,29 @@ func TestSetEndpoints(t *testing.T) {
}},
},
},
{
testName: "existing endpoints extra un-ordered service ports satisfy",
serviceName: "foo",
ip: "1.2.3.4",
endpointPorts: []api.EndpointPort{
{Name: "baz", Port: 1010, Protocol: "TCP"},
{Name: "foo", Port: 8080, Protocol: "TCP"},
{Name: "bar", Port: 1000, Protocol: "TCP"},
},
endpoints: &api.EndpointsList{
Items: []api.Endpoints{{
ObjectMeta: om("foo"),
Subsets: []api.EndpointSubset{{
Addresses: []api.EndpointAddress{{IP: "1.2.3.4"}},
Ports: []api.EndpointPort{
{Name: "bar", Port: 1000, Protocol: "TCP"},
{Name: "foo", Port: 8080, Protocol: "TCP"},
{Name: "baz", Port: 1010, Protocol: "TCP"},
},
}},
}},
},
},
{
testName: "existing endpoints extra service ports missing port",
serviceName: "foo",