mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-06 14:17:12 +02:00
discovery: make endpointSlice discovery more efficient (#16433)
* discovery: a change to a service with the same name but from another namespace won't enqueue the endpointSlice Signed-off-by: Ryan Wu <rongjun0821@gmail.com> * Update discovery/kubernetes/endpointslice.go Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com> Signed-off-by: Ryan Wu <rongjun0821@gmail.com> * Update endpointslice.go Signed-off-by: Ryan Wu <rongjun0821@gmail.com> --------- Signed-off-by: Ryan Wu <rongjun0821@gmail.com> Co-authored-by: Ayoub Mrini <ayoubmrini424@gmail.com>
This commit is contained in:
parent
ba8609fbd0
commit
b4d3c06acb
@ -110,7 +110,8 @@ func NewEndpointSlice(l *slog.Logger, eps cache.SharedIndexInformer, svc, pod, n
|
||||
e.logger.Error("converting to EndpointSlice object failed", "err", err)
|
||||
continue
|
||||
}
|
||||
if lv, exists := es.Labels[v1.LabelServiceName]; exists && lv == svc.Name {
|
||||
// Only consider the underlying EndpointSlices in the same namespace.
|
||||
if svcName, exists := es.Labels[v1.LabelServiceName]; exists && svcName == svc.Name && es.Namespace == svc.Namespace {
|
||||
e.enqueue(es)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user