mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Moved counting logic to accommodate rebase
This commit is contained in:
parent
61b7e6c49c
commit
6454248b6b
@ -1999,6 +1999,14 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode
|
|||||||
// Traffic from an external source will be routed but the reply
|
// Traffic from an external source will be routed but the reply
|
||||||
// will have the POD address and will be discarded.
|
// will have the POD address and will be discarded.
|
||||||
endpoints = clusterEndpoints
|
endpoints = clusterEndpoints
|
||||||
|
|
||||||
|
if svcInfo.InternalPolicyLocal() && utilfeature.DefaultFeatureGate.Enabled(features.ServiceInternalTrafficPolicy) {
|
||||||
|
proxier.serviceNoLocalEndpointsInternal.Insert(svcPortName.NamespacedName.String())
|
||||||
|
}
|
||||||
|
|
||||||
|
if svcInfo.ExternalPolicyLocal() {
|
||||||
|
proxier.serviceNoLocalEndpointsExternal.Insert(svcPortName.NamespacedName.String())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
endpoints = clusterEndpoints
|
endpoints = clusterEndpoints
|
||||||
@ -2009,15 +2017,6 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode
|
|||||||
for _, epInfo := range endpoints {
|
for _, epInfo := range endpoints {
|
||||||
newEndpoints.Insert(epInfo.String())
|
newEndpoints.Insert(epInfo.String())
|
||||||
}
|
}
|
||||||
if onlyNodeLocalEndpoints && len(newEndpoints) == 0 {
|
|
||||||
if svcInfo.InternalPolicyLocal() && utilfeature.DefaultFeatureGate.Enabled(features.ServiceInternalTrafficPolicy) {
|
|
||||||
proxier.serviceNoLocalEndpointsInternal.Insert(svcPortName.NamespacedName.String())
|
|
||||||
}
|
|
||||||
|
|
||||||
if svcInfo.ExternalPolicyLocal() {
|
|
||||||
proxier.serviceNoLocalEndpointsExternal.Insert(svcPortName.NamespacedName.String())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create new endpoints
|
// Create new endpoints
|
||||||
for _, ep := range newEndpoints.List() {
|
for _, ep := range newEndpoints.List() {
|
||||||
|
Loading…
Reference in New Issue
Block a user