Commit 8bb6a5fa authored by Hong Zhiguo's avatar Hong Zhiguo

update TestOnlyLocalNodePorts to make sure only add local RS

parent c6990f97
......@@ -1001,18 +1001,32 @@ func TestOnlyLocalNodePorts(t *testing.T) {
)
epIP := "10.180.0.1"
epIP1 := "10.180.1.1"
thisHostname := testHostname
otherHostname := "other-hostname"
makeEndpointsMap(fp,
makeTestEndpoints(svcPortName.Namespace, svcPortName.Name, func(ept *api.Endpoints) {
ept.Subsets = []api.EndpointSubset{{
Addresses: []api.EndpointAddress{{
IP: epIP,
NodeName: nil,
}},
Ports: []api.EndpointPort{{
Name: svcPortName.Port,
Port: int32(svcPort),
}},
}}
ept.Subsets = []api.EndpointSubset{
{ // **local** endpoint address, should be added as RS
Addresses: []api.EndpointAddress{{
IP: epIP,
NodeName: &thisHostname,
}},
Ports: []api.EndpointPort{{
Name: svcPortName.Port,
Port: int32(svcPort),
}}},
{ // **remote** endpoint address, should not be added as RS
Addresses: []api.EndpointAddress{{
IP: epIP1,
NodeName: &otherHostname,
}},
Ports: []api.EndpointPort{{
Name: svcPortName.Port,
Port: int32(svcPort),
}},
}}
}),
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment