diff --git a/internal/namespaces/get_commands.go b/internal/namespaces/get_commands.go index d3fb5bc4c8..607afb395e 100644 --- a/internal/namespaces/get_commands.go +++ b/internal/namespaces/get_commands.go @@ -36,15 +36,17 @@ import ( "github.com/scaleway/scaleway-cli/v2/internal/namespaces/shell" tem "github.com/scaleway/scaleway-cli/v2/internal/namespaces/tem/v1alpha1" versionNamespace "github.com/scaleway/scaleway-cli/v2/internal/namespaces/version" - "github.com/scaleway/scaleway-cli/v2/internal/namespaces/vpc/v1" + vpcV1 "github.com/scaleway/scaleway-cli/v2/internal/namespaces/vpc/v1" + vpcV2 "github.com/scaleway/scaleway-cli/v2/internal/namespaces/vpc/v2" "github.com/scaleway/scaleway-cli/v2/internal/namespaces/vpcgw/v1" webhosting "github.com/scaleway/scaleway-cli/v2/internal/namespaces/webhosting/v1alpha1" + "github.com/scaleway/scaleway-sdk-go/scw" ) var labs = os.Getenv("SCW_ENABLE_LABS") == "true" // Enable beta in the code when products are in beta -// var beta = os.Getenv(scw.ScwEnableBeta) == "true" +var beta = os.Getenv(scw.ScwEnableBeta) == "true" // GetCommands returns a list of all commands in the CLI. // It is used by both scw and scw-qa. @@ -72,7 +74,7 @@ func GetCommands() *core.Commands { lb.GetCommands(), iot.GetCommands(), help.GetCommands(), - vpc.GetCommands(), + vpcV1.GetCommands(), domain.GetCommands(), applesilicon.GetCommands(), flexibleip.GetCommands(), @@ -91,6 +93,9 @@ func GetCommands() *core.Commands { if labs { commands.Merge(ipfs.GetCommands()) } + if beta { + commands.Merge(vpcV2.GetCommands()) + } return commands } diff --git a/internal/namespaces/vpc/v2/custom.go b/internal/namespaces/vpc/v2/custom.go new file mode 100644 index 0000000000..f2a2c7e919 --- /dev/null +++ b/internal/namespaces/vpc/v2/custom.go @@ -0,0 +1,13 @@ +package vpc + +import ( + "github.com/scaleway/scaleway-cli/v2/internal/core" +) + +func GetCommands() *core.Commands { + cmds := GetGeneratedCommands() + for _, cmd := range cmds.GetAll() { + cmd.Namespace = "vpc_v2" + } + return cmds +}