mirror of
https://github.com/prometheus/prometheus.git
synced 2025-07-03 19:13:23 +00:00
discovery: kubernetes: Avoid creating unnecessary Kubernetes indexers in RoleEndpointSlice
This was due to a missing "return", see https://github.com/prometheus/prometheus/pull/13554#discussion_r1490965817 Signed-off-by: machine424 <ayoubmrini424@gmail.com>
This commit is contained in:
parent
d595f5a9b1
commit
92544c00bf
3 changed files with 51 additions and 4 deletions
|
@ -815,7 +815,7 @@ func (d *Discovery) newEndpointsByNodeInformer(plw *cache.ListWatch) cache.Share
|
|||
func (d *Discovery) newEndpointSlicesByNodeInformer(plw *cache.ListWatch, object runtime.Object) cache.SharedIndexInformer {
|
||||
indexers := make(map[string]cache.IndexFunc)
|
||||
if !d.attachMetadata.Node {
|
||||
cache.NewSharedIndexInformer(plw, &disv1.EndpointSlice{}, resyncDisabled, indexers)
|
||||
return cache.NewSharedIndexInformer(plw, object, resyncDisabled, indexers)
|
||||
}
|
||||
|
||||
indexers[nodeIndex] = func(obj interface{}) ([]string, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue