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 GitHub
parent b50e2ec88c
commit 434e33da9b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View file

@ -186,6 +186,12 @@ func (sc *ScrapeConfig) mustStop() {
for i := range sc.GCESDConfigs {
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.

View file

@ -146,3 +146,8 @@ func addDropletLabels(droplets []droplet, defaultPort int) []map[string]string {
}
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
}
// MustStop stops further usage for sdc.
func (sdc *SDConfig) MustStop() {
configMap.Delete(sdc)
}