lib/promscrape: add missing startWatchersForRole() call at the beginning of apiWatcher.getLabelsForRole

This commit is contained in:
Aliaksandr Valialkin 2021-02-28 13:56:24 +02:00
parent 3721c5353a
commit 6a21ef87b7

View file

@ -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 {