mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +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:
		@@ -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"},
 | 
				
			||||||
		}},
 | 
							}},
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user