This commit is contained in:
GLYASAI 2018-12-04 16:38:42 +08:00
commit 9573c3ae65
2 changed files with 3 additions and 1 deletions

View File

@ -162,6 +162,7 @@ func (t *TenantServicesDaoImpl) GetAllServices() ([]*model.TenantServices, error
return services, nil return services, nil
} }
//GetAllServicesID get all service sample info
func (t *TenantServicesDaoImpl) GetAllServicesID() ([]*model.TenantServices, error) { func (t *TenantServicesDaoImpl) GetAllServicesID() ([]*model.TenantServices, error) {
var services []*model.TenantServices var services []*model.TenantServices
if err := t.DB.Select("service_id,service_alias,tenant_id").Find(&services).Error; err != nil { if err := t.DB.Select("service_id,service_alias,tenant_id").Find(&services).Error; err != nil {
@ -175,7 +176,7 @@ func (t *TenantServicesDaoImpl) GetAllServicesID() ([]*model.TenantServices, err
//UpdateDeployVersion update service current deploy version //UpdateDeployVersion update service current deploy version
func (t *TenantServicesDaoImpl) UpdateDeployVersion(serviceID, deployversion string) error { func (t *TenantServicesDaoImpl) UpdateDeployVersion(serviceID, deployversion string) error {
if err := t.DB.Raw("update tenant_services set deploy_version=? where service_id=?", deployversion, serviceID).Error; err != nil { if err := t.DB.Exec("update tenant_services set deploy_version=? where service_id=?", deployversion, serviceID).Error; err != nil {
return err return err
} }
return nil return nil

View File

@ -645,6 +645,7 @@ func createNodeSelector(as *v1.AppService, dbmanager db.Manager) map[string]stri
if err == nil && labels != nil && len(labels) > 0 { if err == nil && labels != nil && len(labels) > 0 {
for _, l := range labels { for _, l := range labels {
if strings.Contains(l.LabelValue, "=") { if strings.Contains(l.LabelValue, "=") {
kv := strings.SplitN(l.LabelValue, "=", 1)
selector[kv[0]] = kv[1] selector[kv[0]] = kv[1]
} else { } else {
selector["rainbond_node_lable_"+l.LabelValue] = "true" selector["rainbond_node_lable_"+l.LabelValue] = "true"