mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-11-30 02:38:17 +08:00
add patch table sql, return k8s app
This commit is contained in:
parent
965d681354
commit
9d2ca2b5ab
@ -467,6 +467,7 @@ func (a *ApplicationAction) GetStatus(ctx context.Context, app *dbmodel.Applicat
|
||||
Conditions: conditions,
|
||||
AppID: app.AppID,
|
||||
AppName: app.AppName,
|
||||
K8sApp: app.K8sApp,
|
||||
}
|
||||
return res, nil
|
||||
}
|
||||
@ -828,7 +829,7 @@ func changeVolumeDirectoryNames(parentDir, newPath string) error {
|
||||
oldPath := fmt.Sprintf("%s/%s", parentDir, f.Name())
|
||||
newVolPath := newPath + suffix
|
||||
if err := os.Rename(oldPath, newVolPath); err != nil {
|
||||
if err == os.ErrExist || strings.Contains(err.Error(), "file exists"){
|
||||
if err == os.ErrExist || strings.Contains(err.Error(), "file exists") {
|
||||
logrus.Infof("Ingore change volume path err: [%v]", err)
|
||||
continue
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ type AppStatus struct {
|
||||
Version string `json:"version"`
|
||||
Overrides []string `json:"overrides"`
|
||||
Conditions []*AppStatusCondition `json:"conditions"`
|
||||
K8sApp string `json:"k8s_app"`
|
||||
}
|
||||
|
||||
// AppStatusCondition is the conditon of app status.
|
||||
|
@ -204,4 +204,10 @@ func (m *Manager) patchTable() {
|
||||
if err := m.db.Exec("update tenants set namespace=uuid where namespace is NULL;").Error; err != nil {
|
||||
logrus.Errorf("update tenants namespace error: %s", err.Error())
|
||||
}
|
||||
if err := m.db.Exec("update applications set k8s_app=concat('app-',LEFT(app_id,8)) where k8s_app is NULL;").Error; err != nil {
|
||||
logrus.Errorf("update tenants namespace error: %s", err.Error())
|
||||
}
|
||||
if err := m.db.Exec("update tenant_services set k8s_component_name=service_alias where k8s_component_name is NULL;").Error; err != nil {
|
||||
logrus.Errorf("update tenants namespace error: %s", err.Error())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user