mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 18:02:01 +00:00
Remove some now-obviously-unnecessary checks
Now that the endpoint update fields have names that make it clear that they only contain UDP objects, it's obvious that the "protocol == UDP" checks in the iptables and ipvs proxiers were no-ops, so remove them.
This commit is contained in:
parent
c5c0d9f5bd
commit
7696bcd10c
@ -750,7 +750,7 @@ func isServiceChainName(chainString string) bool {
|
||||
// TODO: move it to util
|
||||
func (proxier *Proxier) deleteUDPEndpointConnections(deletedUDPEndpoints []proxy.ServiceEndpoint) {
|
||||
for _, epSvcPair := range deletedUDPEndpoints {
|
||||
if svcInfo, ok := proxier.svcPortMap[epSvcPair.ServicePortName]; ok && svcInfo.Protocol() == v1.ProtocolUDP {
|
||||
if svcInfo, ok := proxier.svcPortMap[epSvcPair.ServicePortName]; ok {
|
||||
endpointIP := utilproxy.IPPart(epSvcPair.Endpoint)
|
||||
nodePort := svcInfo.NodePort()
|
||||
var err error
|
||||
@ -838,7 +838,7 @@ func (proxier *Proxier) syncProxyRules() {
|
||||
// merge stale services gathered from updateEndpointsMap
|
||||
// an UDP service that changes from 0 to non-0 endpoints is considered stale.
|
||||
for _, svcPortName := range endpointUpdateResult.NewlyActiveUDPServices {
|
||||
if svcInfo, ok := proxier.svcPortMap[svcPortName]; ok && svcInfo != nil && svcInfo.Protocol() == v1.ProtocolUDP {
|
||||
if svcInfo, ok := proxier.svcPortMap[svcPortName]; ok {
|
||||
klog.V(4).InfoS("Newly-active UDP service may have stale conntrack entries", "servicePortName", svcPortName)
|
||||
conntrackCleanupServiceIPs.Insert(svcInfo.ClusterIP().String())
|
||||
for _, extIP := range svcInfo.ExternalIPStrings() {
|
||||
|
@ -953,7 +953,7 @@ func (proxier *Proxier) syncProxyRules() {
|
||||
// merge stale services gathered from updateEndpointsMap
|
||||
// an UDP service that changes from 0 to non-0 endpoints is considered stale.
|
||||
for _, svcPortName := range endpointUpdateResult.NewlyActiveUDPServices {
|
||||
if svcInfo, ok := proxier.svcPortMap[svcPortName]; ok && svcInfo != nil && svcInfo.Protocol() == v1.ProtocolUDP {
|
||||
if svcInfo, ok := proxier.svcPortMap[svcPortName]; ok {
|
||||
klog.V(4).InfoS("Newly-active UDP service may have stale conntrack entries", "servicePortName", svcPortName)
|
||||
conntrackCleanupServiceIPs.Insert(svcInfo.ClusterIP().String())
|
||||
for _, extIP := range svcInfo.ExternalIPStrings() {
|
||||
@ -1818,7 +1818,7 @@ func (proxier *Proxier) createAndLinkKubeChain() {
|
||||
// TODO: move it to util
|
||||
func (proxier *Proxier) deleteUDPEndpointConnections(deletedUDPEndpoints []proxy.ServiceEndpoint) {
|
||||
for _, epSvcPair := range deletedUDPEndpoints {
|
||||
if svcInfo, ok := proxier.svcPortMap[epSvcPair.ServicePortName]; ok && svcInfo.Protocol() == v1.ProtocolUDP {
|
||||
if svcInfo, ok := proxier.svcPortMap[epSvcPair.ServicePortName]; ok {
|
||||
endpointIP := utilproxy.IPPart(epSvcPair.Endpoint)
|
||||
nodePort := svcInfo.NodePort()
|
||||
var err error
|
||||
|
Loading…
Reference in New Issue
Block a user