mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 08:23:34 +01:00
fixes openstack api endpoint with suffix trim adds openstack (#840)
api v2.0 check Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/728
This commit is contained in:
parent
8d87b57fbf
commit
a5d842caf8
@ -3,11 +3,13 @@ package openstack
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"path"
|
"path"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -95,6 +97,11 @@ func newAPIConfig(sdc *SDConfig, baseDir string) (*apiConfig, error) {
|
|||||||
// override sdc
|
// override sdc
|
||||||
sdcAuth = readCredentialsFromEnv()
|
sdcAuth = readCredentialsFromEnv()
|
||||||
}
|
}
|
||||||
|
if strings.HasSuffix(sdcAuth.IdentityEndpoint, "v2.0") {
|
||||||
|
return nil, errors.New("identity_endpoint v2.0 is not supported")
|
||||||
|
}
|
||||||
|
// trim .0 from v3.0 for prometheus cfg compatibility
|
||||||
|
sdcAuth.IdentityEndpoint = strings.TrimSuffix(sdcAuth.IdentityEndpoint, ".0")
|
||||||
|
|
||||||
parsedURL, err := url.Parse(sdcAuth.IdentityEndpoint)
|
parsedURL, err := url.Parse(sdcAuth.IdentityEndpoint)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user