Skip to content

Commit

Permalink
adjust target version to 1.3.1 (#170)
Browse files Browse the repository at this point in the history
Signed-off-by: lou <[email protected]>
  • Loading branch information
27149chen authored Aug 12, 2021
1 parent 267f6f1 commit aeb15b8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/cli/upgradeassistant/cmd/migrate/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ import (
const oldServiceTemplateCounterName = "service:%s&type:%s"

func init() {
upgradepath.AddHandler(upgradepath.V130, upgradepath.V140, V130ToV140)
upgradepath.AddHandler(upgradepath.V140, upgradepath.V130, V140ToV130)
upgradepath.AddHandler(upgradepath.V130, upgradepath.V131, V130ToV131)
upgradepath.AddHandler(upgradepath.V131, upgradepath.V130, V131ToV130)
}

// V130ToV140 migrates data from v1.3.0 to v1.4.0 with the following tasks:
// V130ToV131 migrates data from v1.3.0 to v1.3.1 with the following tasks:
// 1. Add field `SharedServices` for all projects
// 2. Add field `ProductName` in field `Services` for all envs
// 3. Change the ServiceTemplateCounterName format
func V130ToV140() error {
fmt.Println("Migrating data from 1.3.0 to 1.4.0")
func V130ToV131() error {
fmt.Println("Migrating data from 1.3.0 to 1.3.1")

allServices, err := mongodb.NewServiceColl().ListMaxRevisions(nil)
if err != nil {
Expand Down Expand Up @@ -126,12 +126,12 @@ func V130ToV140() error {
return nil
}

// V140ToV130 rollbacks the changes from v1.4.0 to v1.3.0 with the following tasks:
// V131ToV130 rollbacks the changes from v1.3.1 to v1.3.0 with the following tasks:
// 1. Remove field `SharedServices` for all projects
// 2. Remove field `ProductName` in field `Services` for all envs
// 3. Revert the ServiceTemplateCounterName format
func V140ToV130() error {
fmt.Println("Rollback data from 1.4.0 to 1.3.0")
func V131ToV130() error {
fmt.Println("Rollback data from 1.3.1 to 1.3.0")

allServices, err := mongodb.NewServiceColl().ListMaxRevisions(nil)
if err != nil {
Expand Down
2 changes: 2 additions & 0 deletions pkg/cli/upgradeassistant/internal/upgradepath/dag.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ import (

const (
V130 = iota
V131
V140
)

var versionMap = map[string]int{
"": V130,
"1.3.0": V130,
"1.3.1": V131,
"1.4.0": V140,
}

Expand Down

0 comments on commit aeb15b8

Please sign in to comment.