Merge pull request #10471 from swordqiu/hotfix/qj-user-info-add-sendpoint-service-type

fix(apigateway): use info response service type of console endpoints
This commit is contained in:
Zexi Li
2021-03-22 14:00:28 +08:00
committed by GitHub
3 changed files with 8 additions and 2 deletions
+1
View File
@@ -1006,6 +1006,7 @@ func getUserInfo2(s *mcclient.ClientSession, uid string, pid string, loginIp str
item := jsonutils.NewDict()
item.Add(jsonutils.NewString(ep.Url), "url")
item.Add(jsonutils.NewString(ep.Name), "name")
item.Add(jsonutils.NewString(ep.Service), "service")
menus.Add(item)
}
+2
View File
@@ -26,6 +26,8 @@ import (
type ExternalService struct {
Name string
Url string
Service string
}
type Endpoint struct {
+5 -2
View File
@@ -316,8 +316,11 @@ func (catalog KeystoneServiceCatalogV3) GetServicesByInterface(region string, in
if catalog[i].Endpoints[j].RegionId == region &&
catalog[i].Endpoints[j].Interface == infType &&
len(catalog[i].Endpoints[j].Name) > 0 {
srv := ExternalService{Name: catalog[i].Endpoints[j].Name,
Url: catalog[i].Endpoints[j].Url}
srv := ExternalService{
Name: catalog[i].Endpoints[j].Name,
Url: catalog[i].Endpoints[j].Url,
Service: catalog[i].Type,
}
services = append(services, srv)
}
}