fix: find empty endpoints due to invalid duplicate service

This commit is contained in:
Qiu Jian
2019-02-21 18:16:17 +08:00
parent 9e24e124f4
commit 2a6737061d
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -191,7 +191,7 @@ func (catalog KeystoneServiceCatalogV2) getRegions() []string {
func (catalog KeystoneServiceCatalogV2) getServiceEndpoint(service, region, zone string) (KeystoneEndpointV2, error) {
var selected KeystoneEndpointV2
for i := 0; i < len(catalog); i++ {
if service == catalog[i].Type {
if service == catalog[i].Type && len(catalog[i].Endpoints) > 0 {
if len(region) == 0 {
if len(catalog[i].Endpoints) >= 1 {
selected = catalog[i].Endpoints[0]
+1 -1
View File
@@ -270,7 +270,7 @@ func (catalog KeystoneServiceCatalogV3) GetServiceURLs(service, region, zone, en
endpointType = "internalURL"
}
for i := 0; i < len(catalog); i++ {
if service == catalog[i].Type {
if service == catalog[i].Type && len(catalog[i].Endpoints) > 0 {
var selected []string
regeps := make(map[string][]string)
regionzone := ""