mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-12 05:21:58 +00:00
update TestOnlyLocalNodePorts to make sure only add local RS
This commit is contained in:
parent
c6990f973f
commit
8bb6a5fa9c
@ -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),
|
||||
}},
|
||||
}}
|
||||
}),
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user