Merge pull request #109624 from aryan9600/fix-endpointslice-deletion
Ignore EndpointSlices that are marked for deletion
This commit is contained in:
@@ -84,7 +84,7 @@ func (est *EndpointSliceTracker) ShouldSync(endpointSlice *discovery.EndpointSli
|
||||
// 1. One or more of the provided EndpointSlices have older generations than the
|
||||
// corresponding tracked ones.
|
||||
// 2. The tracker is expecting one or more of the provided EndpointSlices to be
|
||||
// deleted.
|
||||
// deleted. (EndpointSlices that have already been marked for deletion are ignored here.)
|
||||
// 3. The tracker is tracking EndpointSlices that have not been provided.
|
||||
func (est *EndpointSliceTracker) StaleSlices(service *v1.Service, endpointSlices []*discovery.EndpointSlice) bool {
|
||||
est.lock.Lock()
|
||||
|
@@ -124,6 +124,10 @@ func TestEndpointSliceTrackerStaleSlices(t *testing.T) {
|
||||
epSlice1NewerGen := epSlice1.DeepCopy()
|
||||
epSlice1NewerGen.Generation = 2
|
||||
|
||||
epTerminatingSlice := epSlice1.DeepCopy()
|
||||
now := metav1.Now()
|
||||
epTerminatingSlice.DeletionTimestamp = &now
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
tracker *EndpointSliceTracker
|
||||
|
Reference in New Issue
Block a user