move the ignore logic higher up to the reconciler
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
This commit is contained in:
@@ -364,6 +364,9 @@ func (c *Controller) syncService(key string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// Drop EndpointSlices that have been marked for deletion to prevent the controller from getting stuck.
|
||||
endpointSlices = dropEndpointSlicesPendingDeletion(endpointSlices)
|
||||
|
||||
if c.endpointSliceTracker.StaleSlices(service, endpointSlices) {
|
||||
return endpointsliceutil.NewStaleInformerCache("EndpointSlice informer cache is out of date")
|
||||
}
|
||||
@@ -557,3 +560,14 @@ func trackSync(err error) {
|
||||
}
|
||||
endpointslicemetrics.EndpointSliceSyncs.WithLabelValues(metricLabel).Inc()
|
||||
}
|
||||
|
||||
func dropEndpointSlicesPendingDeletion(endpointSlices []*discovery.EndpointSlice) []*discovery.EndpointSlice {
|
||||
n := 0
|
||||
for _, endpointSlice := range endpointSlices {
|
||||
if endpointSlice.DeletionTimestamp == nil {
|
||||
endpointSlices[n] = endpointSlice
|
||||
n++
|
||||
}
|
||||
}
|
||||
return endpointSlices[:n]
|
||||
}
|
||||
|
Reference in New Issue
Block a user