mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-21 15:45:01 +00:00
lib/promscrape/discovery/kubernetes: do not start object watcher until initial objects are loaded
This commit is contained in:
parent
9e55db4a53
commit
894246176f
1 changed files with 4 additions and 3 deletions
|
@ -490,10 +490,11 @@ func (uw *urlWatcher) watchForUpdates() {
|
||||||
apiURL += delimiter + "watch=1&allowWatchBookmarks=true&timeoutSeconds=" + strconv.Itoa(int(timeoutSeconds))
|
apiURL += delimiter + "watch=1&allowWatchBookmarks=true&timeoutSeconds=" + strconv.Itoa(int(timeoutSeconds))
|
||||||
for {
|
for {
|
||||||
resourceVersion := uw.reloadObjects()
|
resourceVersion := uw.reloadObjects()
|
||||||
requestURL := apiURL
|
if resourceVersion == "" {
|
||||||
if resourceVersion != "" {
|
backoffSleep()
|
||||||
requestURL += "&resourceVersion=" + url.QueryEscape(resourceVersion)
|
continue
|
||||||
}
|
}
|
||||||
|
requestURL := apiURL + "&resourceVersion=" + url.QueryEscape(resourceVersion)
|
||||||
resp, err := uw.gw.doRequest(requestURL)
|
resp, err := uw.gw.doRequest(requestURL)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Errorf("cannot perform request to %q: %s", requestURL, err)
|
logger.Errorf("cannot perform request to %q: %s", requestURL, err)
|
||||||
|
|
Loading…
Reference in a new issue