From 5f593b0ed36c40df7d41009629d6be516a683a1f Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 5 Apr 2021 22:41:48 +0300 Subject: [PATCH] lib/promscrape/discovery/kubernetes: remove superflouos mustStart and mustStop functions --- lib/promscrape/discovery/kubernetes/api.go | 8 -------- lib/promscrape/discovery/kubernetes/kubernetes.go | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/promscrape/discovery/kubernetes/api.go b/lib/promscrape/discovery/kubernetes/api.go index 8afa6b613..fa39666a8 100644 --- a/lib/promscrape/discovery/kubernetes/api.go +++ b/lib/promscrape/discovery/kubernetes/api.go @@ -14,14 +14,6 @@ type apiConfig struct { aw *apiWatcher } -func (ac *apiConfig) mustStart() { - ac.aw.mustStart() -} - -func (ac *apiConfig) mustStop() { - ac.aw.mustStop() -} - func newAPIConfig(sdc *SDConfig, baseDir string, swcFunc ScrapeWorkConstructorFunc) (*apiConfig, error) { switch sdc.Role { case "node", "pod", "service", "endpoints", "endpointslices", "ingress": diff --git a/lib/promscrape/discovery/kubernetes/kubernetes.go b/lib/promscrape/discovery/kubernetes/kubernetes.go index 28160743b..ea827b47a 100644 --- a/lib/promscrape/discovery/kubernetes/kubernetes.go +++ b/lib/promscrape/discovery/kubernetes/kubernetes.go @@ -67,6 +67,6 @@ func (sdc *SDConfig) MustStart(baseDir string, swcFunc ScrapeWorkConstructorFunc func (sdc *SDConfig) MustStop() { if sdc.cfg != nil { // sdc.cfg can be nil on MustStart error. - sdc.cfg.mustStop() + sdc.cfg.aw.mustStop() } }