Skip to content

Commit

Permalink
remove node upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivan Vlasic committed Dec 1, 2021
1 parent e2188fc commit 5a732a9
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 36 deletions.
1 change: 0 additions & 1 deletion domain/file_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ func (s *FileStore) restoreWorkspace() error {
return errors.Wrap(err, "could not unmarshal workspace")
}
s.workspace = &w
s.workspace.upgrade() // TODO safe to remove after 0.2 release
return nil
}

Expand Down
18 changes: 0 additions & 18 deletions domain/file_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,3 @@ func TestNodeResourceNaming(t *testing.T) {
require.Equal(t, "mantil-setup-fpdtuji", n.SetupStackName())
require.Equal(t, "mantil-setup-fpdtuji", n.SetupLambdaName())
}

func TestUpgrade(t *testing.T) {

fs := &FileStore{
workspaceFile: "testdata/pre-0.1.31-workspace.yml",
projectRoot: "testdata",
}
err := fs.restore()
require.NoError(t, err)
n := fs.workspace.Nodes[0]
require.Equal(t, n.ID, "fpdtuji")
require.Equal(t, n.UID, "")
require.Equal(t, n.AccountID, "052548195718")

// buf, err := fs.marshalWorkspace()
// require.NoError(t, err)
// fmt.Printf("%s", buf)
}
17 changes: 0 additions & 17 deletions domain/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ type Node struct {
Functions NodeFunctions `yaml:"functions"`
Stages []*NodeStage `yaml:"stages,omitempty"`
workspace *Workspace

// deprecated migration in n.update
UID string `yaml:"uid,omitempty"` // used as node id, hanled in upgrade()
}

type NodeKeys struct {
Expand Down Expand Up @@ -331,17 +328,3 @@ func (n *Node) Resources() []AwsResource {

return ar
}

func (w *Workspace) upgrade() {
for _, n := range w.Nodes {
n.upgrade()
}
}

func (n *Node) upgrade() {
if n.AccountID == "" && n.UID != "" && n.ID != "" {
n.AccountID = n.ID
n.ID = n.UID
n.UID = ""
}
}

0 comments on commit 5a732a9

Please sign in to comment.