mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-05 22:32:20 +01: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
27b3209816
commit
e6616c74a2
@ -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 New Issue
Block a user