move the ignore logic higher up to the reconciler
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
This commit is contained in:
@@ -100,9 +100,6 @@ func (est *EndpointSliceTracker) StaleSlices(service *v1.Service, endpointSlices
|
||||
providedSlices[endpointSlice.UID] = endpointSlice.Generation
|
||||
g, ok := gfs[endpointSlice.UID]
|
||||
if ok && (g == deletionExpected || g > endpointSlice.Generation) {
|
||||
if endpointSlice.DeletionTimestamp != nil {
|
||||
continue
|
||||
}
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@@ -212,18 +212,6 @@ func TestEndpointSliceTrackerStaleSlices(t *testing.T) {
|
||||
serviceParam: &v1.Service{ObjectMeta: metav1.ObjectMeta{Name: "svc1", Namespace: "ns1"}},
|
||||
slicesParam: []*discovery.EndpointSlice{},
|
||||
expectNewer: true,
|
||||
}, {
|
||||
name: "slice in params is has non nil deletion timestamp",
|
||||
tracker: &EndpointSliceTracker{
|
||||
generationsByService: map[types.NamespacedName]GenerationsBySlice{
|
||||
{Name: "svc1", Namespace: "ns1"}: {
|
||||
epSlice1.UID: epSlice1.Generation,
|
||||
},
|
||||
},
|
||||
},
|
||||
serviceParam: &v1.Service{ObjectMeta: metav1.ObjectMeta{Name: "svc1", Namespace: "ns1"}},
|
||||
slicesParam: []*discovery.EndpointSlice{epTerminatingSlice},
|
||||
expectNewer: false,
|
||||
}}
|
||||
|
||||
for _, tc := range testCases {
|
||||
|
Reference in New Issue
Block a user