lib/promscrape/discovery/kubernetes: register pending apiWatchers in uw.aws

This commit is contained in:
Aliaksandr Valialkin 2021-04-06 11:11:40 +03:00
parent 7fce4e9fb4
commit db56ee0e28

View file

@ -437,6 +437,9 @@ func (uw *urlWatcher) registerPendingAPIWatchers() {
for aw := range uw.awsPending { for aw := range uw.awsPending {
awsPending = append(awsPending, aw) awsPending = append(awsPending, aw)
delete(uw.awsPending, aw) delete(uw.awsPending, aw)
if _, ok := uw.aws[aw]; !ok {
uw.aws[aw] = struct{}{}
}
} }
uw.reloadScrapeWorksForAPIWatchers(awsPending, uw.objectsByKey) uw.reloadScrapeWorksForAPIWatchers(awsPending, uw.objectsByKey)
uw.mu.Unlock() uw.mu.Unlock()