From 530cdba103051d80dee3c973e7ccc339d054e75f Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Sat, 12 Nov 2016 14:13:38 +0100 Subject: [PATCH] kubernetes: only use one error logging handler --- retrieval/discovery/kubernetes/kubernetes.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/retrieval/discovery/kubernetes/kubernetes.go b/retrieval/discovery/kubernetes/kubernetes.go index ed228a5ad..b289c2a98 100644 --- a/retrieval/discovery/kubernetes/kubernetes.go +++ b/retrieval/discovery/kubernetes/kubernetes.go @@ -46,9 +46,11 @@ type Kubernetes struct { } func init() { - runtime.ErrorHandlers = append(runtime.ErrorHandlers, func(err error) { - log.With("component", "kube_client_runtime").Errorln(err) - }) + runtime.ErrorHandlers = []func(error){ + func(err error) { + log.With("component", "kube_client_runtime").Errorln(err) + }, + } } // New creates a new Kubernetes discovery for the given role.