mirror of https://github.com/k3s-io/k3s
Corrected test TestOnlyLocalLoadBalancing
parent
c3c7152c55
commit
227893dc3d
|
@ -1267,18 +1267,32 @@ func TestOnlyLocalLoadBalancing(t *testing.T) {
|
||||||
)
|
)
|
||||||
|
|
||||||
epIP := "10.180.0.1"
|
epIP := "10.180.0.1"
|
||||||
|
epIP1 := "10.180.1.1"
|
||||||
|
thisHostname := testHostname
|
||||||
|
otherHostname := "other-hostname"
|
||||||
|
|
||||||
makeEndpointsMap(fp,
|
makeEndpointsMap(fp,
|
||||||
makeTestEndpoints(svcPortName.Namespace, svcPortName.Name, func(ept *v1.Endpoints) {
|
makeTestEndpoints(svcPortName.Namespace, svcPortName.Name, func(ept *v1.Endpoints) {
|
||||||
ept.Subsets = []v1.EndpointSubset{{
|
ept.Subsets = []v1.EndpointSubset{
|
||||||
Addresses: []v1.EndpointAddress{{
|
{ // **local** endpoint address, should be added as RS
|
||||||
IP: epIP,
|
Addresses: []v1.EndpointAddress{{
|
||||||
NodeName: nil,
|
IP: epIP,
|
||||||
}},
|
NodeName: &thisHostname,
|
||||||
Ports: []v1.EndpointPort{{
|
}},
|
||||||
Name: svcPortName.Port,
|
Ports: []v1.EndpointPort{{
|
||||||
Port: int32(svcPort),
|
Name: svcPortName.Port,
|
||||||
}},
|
Port: int32(svcPort),
|
||||||
}}
|
}}},
|
||||||
|
{ // **remote** endpoint address, should not be added as RS
|
||||||
|
Addresses: []v1.EndpointAddress{{
|
||||||
|
IP: epIP1,
|
||||||
|
NodeName: &otherHostname,
|
||||||
|
}},
|
||||||
|
Ports: []v1.EndpointPort{{
|
||||||
|
Name: svcPortName.Port,
|
||||||
|
Port: int32(svcPort),
|
||||||
|
}},
|
||||||
|
}}
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue