mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
kube-proxy: ipvs proxy should ignore endpoints with condition ready=false
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
This commit is contained in:
parent
9c096292cc
commit
a11abb5475
@ -2042,9 +2042,14 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, epInfo := range endpoints {
|
for _, epInfo := range endpoints {
|
||||||
|
if !epInfo.IsReady() {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if onlyNodeLocalEndpoints && !epInfo.GetIsLocal() {
|
if onlyNodeLocalEndpoints && !epInfo.GetIsLocal() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
newEndpoints.Insert(epInfo.String())
|
newEndpoints.Insert(epInfo.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4256,6 +4256,10 @@ func TestEndpointSliceE2E(t *testing.T) {
|
|||||||
Addresses: []string{"10.0.1.3"},
|
Addresses: []string{"10.0.1.3"},
|
||||||
Conditions: discovery.EndpointConditions{Ready: utilpointer.BoolPtr(true)},
|
Conditions: discovery.EndpointConditions{Ready: utilpointer.BoolPtr(true)},
|
||||||
Topology: map[string]string{"kubernetes.io/hostname": "node3"},
|
Topology: map[string]string{"kubernetes.io/hostname": "node3"},
|
||||||
|
}, { // not ready endpoints should be ignored
|
||||||
|
Addresses: []string{"10.0.1.4"},
|
||||||
|
Conditions: discovery.EndpointConditions{Ready: utilpointer.BoolPtr(false)},
|
||||||
|
Topology: map[string]string{"kubernetes.io/hostname": "node3"},
|
||||||
}},
|
}},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user