From 6a21ef87b7c47e7f9a257af7b7d649eacca13118 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sun, 28 Feb 2021 13:56:24 +0200 Subject: [PATCH] lib/promscrape: add missing `startWatchersForRole()` call at the beginning of `apiWatcher.getLabelsForRole` --- lib/promscrape/discovery/kubernetes/api.go | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/promscrape/discovery/kubernetes/api.go b/lib/promscrape/discovery/kubernetes/api.go index 112c259df..ca77b10de 100644 --- a/lib/promscrape/discovery/kubernetes/api.go +++ b/lib/promscrape/discovery/kubernetes/api.go @@ -163,6 +163,7 @@ func newAPIWatcher(client *http.Client, apiServer, authorization string, namespa // getLabelsForRole returns all the sets of labels for the given role. func (aw *apiWatcher) getLabelsForRole(role string) []map[string]string { + aw.startWatchersForRole(role) var ms []map[string]string aw.mu.Lock() for _, uw := range aw.watchersByURL {