diff --git a/discovery/kubernetes/endpoints.go b/discovery/kubernetes/endpoints.go index 679934dd4..f905ae92c 100644 --- a/discovery/kubernetes/endpoints.go +++ b/discovery/kubernetes/endpoints.go @@ -169,7 +169,7 @@ func (e *Endpoints) process(ctx context.Context, ch chan<- []*targetgroup.Group) return true } if !exists { - send(ctx, e.logger, RoleEndpoint, ch, &targetgroup.Group{Source: endpointsSourceFromNamespaceAndName(namespace, name)}) + send(ctx, ch, &targetgroup.Group{Source: endpointsSourceFromNamespaceAndName(namespace, name)}) return true } eps, err := convertToEndpoints(o) @@ -177,7 +177,7 @@ func (e *Endpoints) process(ctx context.Context, ch chan<- []*targetgroup.Group) level.Error(e.logger).Log("msg", "converting to Endpoints object failed", "err", err) return true } - send(ctx, e.logger, RoleEndpoint, ch, e.buildEndpoints(eps)) + send(ctx, ch, e.buildEndpoints(eps)) return true } diff --git a/discovery/kubernetes/ingress.go b/discovery/kubernetes/ingress.go index 27b4e8a6a..481789900 100644 --- a/discovery/kubernetes/ingress.go +++ b/discovery/kubernetes/ingress.go @@ -109,7 +109,7 @@ func (i *Ingress) process(ctx context.Context, ch chan<- []*targetgroup.Group) b return true } if !exists { - send(ctx, i.logger, RoleIngress, ch, &targetgroup.Group{Source: ingressSourceFromNamespaceAndName(namespace, name)}) + send(ctx, ch, &targetgroup.Group{Source: ingressSourceFromNamespaceAndName(namespace, name)}) return true } eps, err := convertToIngress(o) @@ -117,7 +117,7 @@ func (i *Ingress) process(ctx context.Context, ch chan<- []*targetgroup.Group) b level.Error(i.logger).Log("msg", "converting to Ingress object failed", "err", err) return true } - send(ctx, i.logger, RoleIngress, ch, i.buildIngress(eps)) + send(ctx, ch, i.buildIngress(eps)) return true } diff --git a/discovery/kubernetes/kubernetes.go b/discovery/kubernetes/kubernetes.go index abfdcc3d4..9325794c7 100644 --- a/discovery/kubernetes/kubernetes.go +++ b/discovery/kubernetes/kubernetes.go @@ -470,7 +470,7 @@ func lv(s string) model.LabelValue { return model.LabelValue(s) } -func send(ctx context.Context, l log.Logger, role Role, ch chan<- []*targetgroup.Group, tg *targetgroup.Group) { +func send(ctx context.Context, ch chan<- []*targetgroup.Group, tg *targetgroup.Group) { if tg == nil { return } diff --git a/discovery/kubernetes/node.go b/discovery/kubernetes/node.go index bf57dd767..d196358df 100644 --- a/discovery/kubernetes/node.go +++ b/discovery/kubernetes/node.go @@ -118,7 +118,7 @@ func (n *Node) process(ctx context.Context, ch chan<- []*targetgroup.Group) bool return true } if !exists { - send(ctx, n.logger, RoleNode, ch, &targetgroup.Group{Source: nodeSourceFromName(name)}) + send(ctx, ch, &targetgroup.Group{Source: nodeSourceFromName(name)}) return true } node, err := convertToNode(o) @@ -126,7 +126,7 @@ func (n *Node) process(ctx context.Context, ch chan<- []*targetgroup.Group) bool level.Error(n.logger).Log("msg", "converting to Node object failed", "err", err) return true } - send(ctx, n.logger, RoleNode, ch, n.buildNode(node)) + send(ctx, ch, n.buildNode(node)) return true } diff --git a/discovery/kubernetes/pod.go b/discovery/kubernetes/pod.go index 4a465abe9..86fa31f7f 100644 --- a/discovery/kubernetes/pod.go +++ b/discovery/kubernetes/pod.go @@ -121,7 +121,7 @@ func (p *Pod) process(ctx context.Context, ch chan<- []*targetgroup.Group) bool return true } if !exists { - send(ctx, p.logger, RolePod, ch, &targetgroup.Group{Source: podSourceFromNamespaceAndName(namespace, name)}) + send(ctx, ch, &targetgroup.Group{Source: podSourceFromNamespaceAndName(namespace, name)}) return true } eps, err := convertToPod(o) @@ -129,7 +129,7 @@ func (p *Pod) process(ctx context.Context, ch chan<- []*targetgroup.Group) bool level.Error(p.logger).Log("msg", "converting to Pod object failed", "err", err) return true } - send(ctx, p.logger, RolePod, ch, p.buildPod(eps)) + send(ctx, ch, p.buildPod(eps)) return true } diff --git a/discovery/kubernetes/service.go b/discovery/kubernetes/service.go index a3136e0a3..017f4ba65 100644 --- a/discovery/kubernetes/service.go +++ b/discovery/kubernetes/service.go @@ -114,7 +114,7 @@ func (s *Service) process(ctx context.Context, ch chan<- []*targetgroup.Group) b return true } if !exists { - send(ctx, s.logger, RoleService, ch, &targetgroup.Group{Source: serviceSourceFromNamespaceAndName(namespace, name)}) + send(ctx, ch, &targetgroup.Group{Source: serviceSourceFromNamespaceAndName(namespace, name)}) return true } eps, err := convertToService(o) @@ -122,7 +122,7 @@ func (s *Service) process(ctx context.Context, ch chan<- []*targetgroup.Group) b level.Error(s.logger).Log("msg", "converting to Service object failed", "err", err) return true } - send(ctx, s.logger, RoleService, ch, s.buildService(eps)) + send(ctx, ch, s.buildService(eps)) return true }