Skip to content

Commit e4debf7

Browse files
committed
add scaffolding for convert command adv_cluster v1 to v2
1 parent 6fcce27 commit e4debf7

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

cmd/plugin/main.go

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

7+
"github.com/mongodb-labs/atlas-cli-plugin-terraform/internal/cli/adv2"
78
"github.com/mongodb-labs/atlas-cli-plugin-terraform/internal/cli/clu2adv"
89
"github.com/spf13/cobra"
910
)
@@ -14,10 +15,7 @@ func main() {
1415
Short: "Utilities for Terraform's MongoDB Atlas Provider",
1516
Aliases: []string{"tf"},
1617
}
17-
18-
terraformCmd.AddCommand(
19-
clu2adv.Builder(),
20-
)
18+
terraformCmd.AddCommand(clu2adv.Builder(), adv2.Builder())
2119

2220
completionOption := &cobra.CompletionOptions{
2321
DisableDefaultCmd: true,

internal/cli/adv2/adv2.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package adv2
2+
3+
import (
4+
"errors"
5+
6+
"github.com/spf13/cobra"
7+
)
8+
9+
func Builder() *cobra.Command {
10+
cmd := &cobra.Command{
11+
Use: "advancedClusterV1ToV2",
12+
Short: "Convert advanced_cluster v1 to v2",
13+
Long: "Convert a Terraform configuration from mongodbatlas_advanced_cluster schema v1 to v2",
14+
Aliases: []string{"adv2"},
15+
RunE: func(_ *cobra.Command, _ []string) error {
16+
return errors.New("TODO: not implemented yet, will be implemented in the future")
17+
},
18+
}
19+
return cmd
20+
}

0 commit comments

Comments
 (0)