[FIX] fix bug

This commit is contained in:
zhoujunhao 2018-08-29 10:44:58 +08:00
parent 0a62cf3a6e
commit 7c81ca321b
3 changed files with 14 additions and 7 deletions

View File

@ -1769,8 +1769,8 @@ func (s *ServiceAction) CreateTenandIDAndName(eid string) (string, string, error
type K8sPodInfo struct {
ServiceID string `json:"service_id"`
//部署资源的ID ,例如rc ,deploment, statefulset
ReplicationID string `json:"replication_id"`
ReplicationType string `json:"replication_type"`
ReplicationID string `json:"rc_id"`
ReplicationType string `json:"rc_type"`
PodName string `json:"pod_name"`
PodIP string `json:"pod_ip"`
Container map[string]map[string]string `json:"container"`

View File

@ -70,6 +70,13 @@ type APIConf struct {
CertKey string `yaml:"tls-private-key-file"`
}
type serviceInfo struct {
ServicesAlias string `json:"serviceAlias"`
TenantName string `json:"tenantName"`
ServiceId string `json:"serviceId"`
TenantId string `json:"tenantId"`
}
//NewRegion NewRegion
func NewRegion(c APIConf) (Region, error) {
if region == nil {
@ -188,7 +195,7 @@ func (t *tenant) Services(serviceAlias string) ServiceInterface {
//ServiceInterface ServiceInterface
type ServiceInterface interface {
Get() (*dbmodel.TenantServices, *util.APIHandleError)
Get() (*serviceInfo, *util.APIHandleError)
Pods() ([]*dbmodel.K8sPod, *util.APIHandleError)
List() ([]*dbmodel.TenantServices, *util.APIHandleError)
Stop(eventID string) (string, *util.APIHandleError)
@ -209,8 +216,8 @@ func (s *services) Pods() ([]*dbmodel.K8sPod, *util.APIHandleError) {
}
return gc, nil
}
func (s *services) Get() (*dbmodel.TenantServices, *util.APIHandleError) {
var service dbmodel.TenantServices
func (s *services) Get() (*serviceInfo, *util.APIHandleError) {
var service serviceInfo
var decode utilhttp.ResponseBody
decode.Bean = &service
code, err := s.DoRequest(s.prefix, "GET", nil, &decode)

View File

@ -336,8 +336,8 @@ func getAppInfoV2(c *cli.Context) error {
table := uitable.New()
table.Wrap = true // wrap columns
tenantID := service.TenantID
serviceID := service.ServiceID
tenantID := service.TenantId
serviceID := service.ServiceId
//volumes:=service[""]
table.AddRow("Namespace:", tenantID)