adds missing MustStop call to do and http sd (#1404)

This commit is contained in:
Nikolay 2021-06-25 11:39:18 +03:00 committed by Aliaksandr Valialkin
parent f1a2aa0992
commit 501429c3ff
3 changed files with 16 additions and 0 deletions

View file

@ -186,6 +186,12 @@ func (sc *ScrapeConfig) mustStop() {
for i := range sc.GCESDConfigs { for i := range sc.GCESDConfigs {
sc.GCESDConfigs[i].MustStop() sc.GCESDConfigs[i].MustStop()
} }
for i := range sc.DigitaloceanSDConfigs {
sc.DigitaloceanSDConfigs[i].MustStop()
}
for i := range sc.HTTPSDConfigs {
sc.HTTPSDConfigs[i].MustStop()
}
} }
// FileSDConfig represents file-based service discovery config. // FileSDConfig represents file-based service discovery config.

View file

@ -146,3 +146,8 @@ func addDropletLabels(droplets []droplet, defaultPort int) []map[string]string {
} }
return ms return ms
} }
// MustStop stops further usage for sdc.
func (sdc *SDConfig) MustStop() {
configMap.Delete(sdc)
}

View file

@ -53,3 +53,8 @@ func addHTTPTargetLabels(src []httpGroupTarget, sourceURL string) []map[string]s
} }
return ms return ms
} }
// MustStop stops further usage for sdc.
func (sdc *SDConfig) MustStop() {
configMap.Delete(sdc)
}