[FIX] fix app service deploy version failure bug

This commit is contained in:
barnett 2018-11-28 19:32:39 +08:00
parent 02a82b15a1
commit 227fa6c546
4 changed files with 8 additions and 6 deletions

View File

@ -36,11 +36,11 @@ import (
"github.com/pquerna/ffjson/ffjson"
gclient "github.com/goodrain/rainbond/mq/api/grpc/client"
api_db "github.com/goodrain/rainbond/api/db"
api_model "github.com/goodrain/rainbond/api/model"
"github.com/goodrain/rainbond/api/util"
dbmodel "github.com/goodrain/rainbond/db/model"
gclient "github.com/goodrain/rainbond/mq/api/grpc/client"
core_util "github.com/goodrain/rainbond/util"
"github.com/goodrain/rainbond/worker/client"
"github.com/goodrain/rainbond/worker/discover/model"
@ -1292,7 +1292,7 @@ func (s *ServiceAction) RollBack(rs *api_model.RollbackStruct) error {
TenantID: rs.TenantID,
ServiceID: rs.ServiceID,
EventID: rs.EventID,
TaskType: "upgrade",
TaskType: "rolling_upgrade",
}
if err := GetServiceManager().StartStopService(startStopStruct); err != nil {
tx.Rollback()

View File

@ -69,9 +69,8 @@ func InitAppService(dbmanager db.Manager, serviceID string) (*v1.AppService, err
func InitCacheAppService(dbmanager db.Manager, serviceID, version, createrID string) (*v1.AppService, error) {
appService := &v1.AppService{
AppServiceBase: v1.AppServiceBase{
ServiceID: serviceID,
DeployVersion: version,
CreaterID: createrID,
ServiceID: serviceID,
CreaterID: createrID,
},
UpgradePatch: make(map[string][]byte, 2),
}

View File

@ -30,7 +30,8 @@ import (
func (a *appRuntimeStore) clean() {
util.Exec(a.ctx, func() error {
a.appServices.Range(func(k, v interface{}) bool {
//TODO
//appservice := v.(*v1.AppService)
//fmt.Println(appservice.String())
return true
})
logrus.Debugf("app store is cleaned")

View File

@ -382,6 +382,7 @@ func (a *AppService) String() string {
return fmt.Sprintf(`
-----------------------------------------------------
App:%s
DeployVersion:%s
Statefulset %+v
Deployment %+v
Pod %d
@ -390,6 +391,7 @@ func (a *AppService) String() string {
-----------------------------------------------------
`,
a.ServiceAlias,
a.DeployVersion,
a.statefulset,
a.deployment,
len(a.pods),