mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-10 15:14:09 +00:00
fixes all_tenants query option usage for openstack service discovery (#2184)
explicit use configuration parametr instead of conditional add https://github.com/VictoriaMetrics/VictoriaMetrics/issues/2182
This commit is contained in:
parent
d924f4b7ba
commit
c90c1c4d54
2 changed files with 5 additions and 7 deletions
|
@ -33,7 +33,7 @@ type apiConfig struct {
|
|||
// tokenLock guards creds refresh
|
||||
tokenLock sync.Mutex
|
||||
creds *apiCredentials
|
||||
// authTokenReq contins request body for apiCredentials
|
||||
// authTokenReq contains request body for apiCredentials
|
||||
authTokenReq []byte
|
||||
// keystone endpoint
|
||||
endpoint *url.URL
|
||||
|
|
|
@ -5,6 +5,7 @@ import (
|
|||
"fmt"
|
||||
"path"
|
||||
"sort"
|
||||
"strconv"
|
||||
|
||||
"github.com/VictoriaMetrics/VictoriaMetrics/lib/promscrape/discoveryutils"
|
||||
)
|
||||
|
@ -110,12 +111,9 @@ func (cfg *apiConfig) getServers() ([]server, error) {
|
|||
}
|
||||
computeURL := *creds.computeURL
|
||||
computeURL.Path = path.Join(computeURL.Path, "servers", "detail")
|
||||
// by default, query fetches data from all tenants
|
||||
if !cfg.allTenants {
|
||||
q := computeURL.Query()
|
||||
q.Set("all_tenants", "false")
|
||||
computeURL.RawQuery = q.Encode()
|
||||
}
|
||||
q := computeURL.Query()
|
||||
q.Set("all_tenants", strconv.FormatBool(cfg.allTenants))
|
||||
computeURL.RawQuery = q.Encode()
|
||||
nextLink := computeURL.String()
|
||||
var servers []server
|
||||
for {
|
||||
|
|
Loading…
Reference in a new issue