mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-03-11 15:34:56 +00:00
lib/promscrape/discovery/openstack: use port 80 for the discovered target by default if it isnt specified in the config
This commit is contained in:
parent
25a9017a72
commit
f9b3409ee3
1 changed files with 5 additions and 1 deletions
|
@ -69,6 +69,10 @@ func getAPIConfig(sdc *SDConfig, baseDir string) (*apiConfig, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func newAPIConfig(sdc *SDConfig, baseDir string) (*apiConfig, error) {
|
func newAPIConfig(sdc *SDConfig, baseDir string) (*apiConfig, error) {
|
||||||
|
port := sdc.Port
|
||||||
|
if port == 0 {
|
||||||
|
port = 80
|
||||||
|
}
|
||||||
cfg := &apiConfig{
|
cfg := &apiConfig{
|
||||||
client: &http.Client{
|
client: &http.Client{
|
||||||
Transport: &http.Transport{
|
Transport: &http.Transport{
|
||||||
|
@ -78,7 +82,7 @@ func newAPIConfig(sdc *SDConfig, baseDir string) (*apiConfig, error) {
|
||||||
availability: sdc.Availability,
|
availability: sdc.Availability,
|
||||||
region: sdc.Region,
|
region: sdc.Region,
|
||||||
allTenants: sdc.AllTenants,
|
allTenants: sdc.AllTenants,
|
||||||
port: sdc.Port,
|
port: port,
|
||||||
}
|
}
|
||||||
if sdc.TLSConfig != nil {
|
if sdc.TLSConfig != nil {
|
||||||
opts := &promauth.Options{
|
opts := &promauth.Options{
|
||||||
|
|
Loading…
Reference in a new issue