diff --git a/README.md b/README.md index 07c2d1224a..e6aad1899d 100644 --- a/README.md +++ b/README.md @@ -160,11 +160,6 @@ See more in-depth information about running the CLI in Docker [here](./docs/dock This repository is at its early stage and is still in active development. If you are looking for a way to contribute please read [CONTRIBUTING.md](./.github/CONTRIBUTING.md). -# Legacy version - -If you are looking for the legacy CLIv1 you can take a look at the [v1 branch](https://github.com/scaleway/scaleway-cli/blob/v1/README.md). -We also wrote [a migration guide](./docs/migration_guide_v2.md) to help transition to the CLIv2. - # Reach Us We love feedback. diff --git a/go.mod b/go.mod index b1665cea31..59ad1efbd0 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/kubernetes-client/go-base v0.0.0-20190205182333-3d0e39759d98 github.com/mattn/go-colorable v0.1.13 github.com/mattn/go-isatty v0.0.16 - github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10.0.20221130161646-e0f8387f73a0 + github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10.0.20221214161016-653cd5e743a9 github.com/spf13/cobra v1.6.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 diff --git a/go.sum b/go.sum index a45667065b..e2411cc55a 100644 --- a/go.sum +++ b/go.sum @@ -73,6 +73,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10.0.20221130161646-e0f8387f73a0 h1:pSsfbPPYDUGIeqhoIzHIMrynJPOXTPwnjiVH6sXfZ8c= github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10.0.20221130161646-e0f8387f73a0/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10.0.20221214161016-653cd5e743a9 h1:rkMAWlN4gd7KuWvL77KLTi4Xwff6u26R9sTVIzx6554= +github.com/scaleway/scaleway-sdk-go v1.0.0-beta.10.0.20221214161016-653cd5e743a9/go.mod h1:fCa7OJZ/9DRTnOKmxvT6pn+LPWUptQAmHF/SBJUGEcg= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= diff --git a/internal/core/client.go b/internal/core/client.go index 7d6cb1246b..756242bd12 100644 --- a/internal/core/client.go +++ b/internal/core/client.go @@ -14,10 +14,6 @@ import ( // createClient creates a Scaleway SDK client. func createClient(ctx context.Context, httpClient *http.Client, buildInfo *BuildInfo, profileName string) (*scw.Client, error) { - if _, err := scw.MigrateLegacyConfig(); err != nil { - return nil, err - } - profile := scw.LoadEnvProfile() // Default path is based on the following priority order: diff --git a/internal/namespaces/init/custom_init_autocomplete_test.go b/internal/namespaces/init/custom_init_autocomplete_test.go index d92cae27ca..9a37ea783a 100644 --- a/internal/namespaces/init/custom_init_autocomplete_test.go +++ b/internal/namespaces/init/custom_init_autocomplete_test.go @@ -27,11 +27,10 @@ const ( func Test_InitAutocomplete(t *testing.T) { defaultSettings := map[string]string{ - "access-key": "{{ .AccessKey }}", - "secret-key": "{{ .SecretKey }}", - "send-telemetry": "false", - "remove-v1-config": "false", - "with-ssh-key": "false", + "access-key": "{{ .AccessKey }}", + "secret-key": "{{ .SecretKey }}", + "send-telemetry": "false", + "with-ssh-key": "false", } runAllShells := func(t *testing.T) { diff --git a/internal/namespaces/init/custom_init_ssh_test.go b/internal/namespaces/init/custom_init_ssh_test.go index 85b3558c32..884a884b78 100644 --- a/internal/namespaces/init/custom_init_ssh_test.go +++ b/internal/namespaces/init/custom_init_ssh_test.go @@ -71,7 +71,6 @@ func Test_InitSSH(t *testing.T) { "access-key": "{{ .AccessKey }}", "secret-key": "{{ .SecretKey }}", "send-telemetry": "false", - "remove-v1-config": "false", "install-autocomplete": "false", } cmds := GetCommands() diff --git a/internal/namespaces/init/init.go b/internal/namespaces/init/init.go index 4107e4c5c9..14787b3c1d 100644 --- a/internal/namespaces/init/init.go +++ b/internal/namespaces/init/init.go @@ -3,8 +3,6 @@ package init import ( "context" "fmt" - "os" - "path" "reflect" "strings" @@ -67,7 +65,6 @@ type initArgs struct { SendTelemetry *bool WithSSHKey *bool InstallAutocomplete *bool - RemoveV1Config *bool } func initCommand() *core.Command { @@ -102,10 +99,6 @@ Default path for configuration file is based on the following priority order: Name: "install-autocomplete", Short: "Whether the autocomplete script should be installed during initialisation", }, - { - Name: "remove-v1-config", - Short: "Whether to remove the v1 configuration file if it exists", - }, core.RegionArgSpec(scw.RegionFrPar, scw.RegionNlAms), core.ZoneArgSpec(scw.ZoneFrPar1, scw.ZoneFrPar2, scw.ZoneNlAms1), }, @@ -229,26 +222,6 @@ Default path for configuration file is based on the following priority order: args.InstallAutocomplete = scw.BoolPtr(installAutocomplete) } - // Ask whether to remove v1 configuration file if it exists - if args.RemoveV1Config == nil { - homeDir := core.ExtractUserHomeDir(ctx) - if err == nil { - configPath := path.Join(homeDir, ".scwrc") - if _, err := os.Stat(configPath); err == nil { - removeV1ConfigFile, err := interactive.PromptBoolWithConfig(&interactive.PromptBoolConfig{ - Ctx: ctx, - Prompt: "Do you want to permanently remove old configuration file (" + configPath + ")?", - DefaultValue: false, - }) - if err != nil { - return err - } - - args.RemoveV1Config = &removeV1ConfigFile - } - } - } - return nil }, Run: func(ctx context.Context, argsI interface{}) (i interface{}, e error) { @@ -328,15 +301,6 @@ Default path for configuration file is based on the following priority order: } } - // Remove old configuration file - if args.RemoveV1Config != nil && *args.RemoveV1Config { - homeDir := core.ExtractUserHomeDir(ctx) - err = os.Remove(path.Join(homeDir, ".scwrc")) - if err != nil { - successDetails = append(successDetails, "Except for removing old configuration: "+err.Error()) - } - } - _, _ = interactive.Println() return &core.SuccessResult{ diff --git a/internal/namespaces/init/init_test.go b/internal/namespaces/init/init_test.go index 0b570ddba9..373bf13300 100644 --- a/internal/namespaces/init/init_test.go +++ b/internal/namespaces/init/init_test.go @@ -41,7 +41,6 @@ func TestInit(t *testing.T) { "secret-key": "{{ .SecretKey }}", "send-telemetry": "true", "install-autocomplete": "false", - "remove-v1-config": "false", "with-ssh-key": "false", }