From db56ee0e28ac753f4864cee7163bc07b8d54a6e1 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 6 Apr 2021 11:11:40 +0300 Subject: [PATCH] lib/promscrape/discovery/kubernetes: register pending apiWatchers in uw.aws --- lib/promscrape/discovery/kubernetes/api_watcher.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/promscrape/discovery/kubernetes/api_watcher.go b/lib/promscrape/discovery/kubernetes/api_watcher.go index d5def2f29..e6c56212b 100644 --- a/lib/promscrape/discovery/kubernetes/api_watcher.go +++ b/lib/promscrape/discovery/kubernetes/api_watcher.go @@ -437,6 +437,9 @@ func (uw *urlWatcher) registerPendingAPIWatchers() { for aw := range uw.awsPending { awsPending = append(awsPending, aw) delete(uw.awsPending, aw) + if _, ok := uw.aws[aw]; !ok { + uw.aws[aw] = struct{}{} + } } uw.reloadScrapeWorksForAPIWatchers(awsPending, uw.objectsByKey) uw.mu.Unlock()