Skip to content

Commit 32398ac

Browse files
committed
rename advancedClusterToNew to advancedClusterToV2
1 parent 769bca1 commit 32398ac

File tree

13 files changed

+24
-24
lines changed

13 files changed

+24
-24
lines changed

cmd/plugin/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"os"
66

7-
"github.com/mongodb-labs/atlas-cli-plugin-terraform/internal/cli/adv2new"
7+
"github.com/mongodb-labs/atlas-cli-plugin-terraform/internal/cli/adv2v2"
88
"github.com/mongodb-labs/atlas-cli-plugin-terraform/internal/cli/clu2adv"
99
"github.com/spf13/cobra"
1010
)
@@ -16,7 +16,7 @@ func main() {
1616
Aliases: []string{"tf"},
1717
}
1818
terraformCmd.AddCommand(clu2adv.Builder())
19-
terraformCmd.AddCommand(adv2new.Builder())
19+
terraformCmd.AddCommand(adv2v2.Builder())
2020

2121
completionOption := &cobra.CompletionOptions{
2222
DisableDefaultCmd: true,

internal/cli/adv2new/adv2new.go renamed to internal/cli/adv2v2/adv2v2.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package adv2new
1+
package adv2v2
22

33
import (
44
"github.com/mongodb-labs/atlas-cli-plugin-terraform/internal/cli"
@@ -10,14 +10,14 @@ import (
1010
func Builder() *cobra.Command {
1111
o := &cli.BaseOpts{
1212
Fs: afero.NewOsFs(),
13-
Convert: convert.AdvancedClusterToNew,
13+
Convert: convert.AdvancedClusterToV2,
1414
}
1515
cmd := &cobra.Command{
16-
Use: "advancedClusterToNew",
16+
Use: "advancedClusterToV2",
1717
Short: "Convert advanced_cluster from provider version 1 to 2",
1818
Long: "Convert a Terraform configuration from mongodbatlas_advanced_cluster in provider version 1.X.X (SDKv2)" +
1919
" to version 2.X.X (TPF - Terraform Plugin Framework)",
20-
Aliases: []string{"adv2new"},
20+
Aliases: []string{"adv2v2"},
2121
RunE: o.RunE,
2222
}
2323
cli.SetupCommonFlags(cmd, o)

internal/convert/adv2new_test.go

Lines changed: 0 additions & 13 deletions
This file was deleted.

internal/convert/adv2new.go renamed to internal/convert/adv2v2.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package convert
22

33
import "github.com/mongodb-labs/atlas-cli-plugin-terraform/internal/hcl"
44

5-
// AdvancedClusterToNew transforms all mongodbatlas_advanced_cluster resource definitions in a
5+
// AdvancedClusterToV2 transforms all mongodbatlas_advanced_cluster resource definitions in a
66
// Terraform configuration file from SDKv2 schema to TPF (Terraform Plugin Framework) schema.
77
// All other resources and data sources are left untouched.
88
// TODO: Not implemented yet.
9-
func AdvancedClusterToNew(config []byte) ([]byte, error) {
9+
func AdvancedClusterToV2(config []byte) ([]byte, error) {
1010
parser, err := hcl.GetParser(config)
1111
if err != nil {
1212
return nil, err

internal/convert/adv2v2_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package convert_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/mongodb-labs/atlas-cli-plugin-terraform/internal/convert"
7+
)
8+
9+
func TestAdvancedClusterToV2(t *testing.T) {
10+
runConvertTests(t, "adv2v2", func(testName string, inConfig []byte) ([]byte, error) {
11+
return convert.AdvancedClusterToV2(inConfig)
12+
})
13+
}

test/e2e/adv2new_test.go renamed to test/e2e/adv2v2_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ import (
66
"github.com/mongodb-labs/atlas-cli-plugin-terraform/test/e2e"
77
)
88

9-
func TestAdv2New(t *testing.T) {
10-
e2e.RunTests(t, "adv2new", nil)
9+
func TestAdvancedClusterToV2(t *testing.T) {
10+
e2e.RunTests(t, "adv2v2", nil)
1111
}

0 commit comments

Comments
 (0)