mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 12:18:16 +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:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user